Question 1164633
```python?code_reference&code_event_index=2
brackets = [
    (0, 9525, 0.10),
    (9525, 38700, 0.12),
    (38700, 82500, 0.22),
    (82500, 157500, 0.24),
    (157500, 200000, 0.32),
    (200000, 500000, 0.35),
    (500000, float('inf'), 0.37)
]

cumulative_taxes = []
prev_limit = 0
total_tax = 0

for low, high, rate in brackets[:-1]:
    tax_in_bracket = (high - low) * rate
    total_tax += tax_in_bracket
    cumulative_taxes.append(total_tax)

print(f"Cumulative taxes at thresholds: {cumulative_taxes}")

def calculate_tax(income):
    tax = 0
    for low, high, rate in brackets:
        if income > low:
            taxable_amount = min(income, high) - low
            tax += taxable_amount * rate
        else:
            break
    return tax

monthly_income = 40000
annual_income = monthly_income * 12
tax_due = calculate_tax(annual_income)

print(f"Annual Income: {annual_income}")
print(f"Tax Due: {tax_due}")


```
```text?code_stdout&code_event_index=2
Cumulative taxes at thresholds: [952.5, 4453.5, 14089.5, 32089.5, 45689.5, 150689.5]
Annual Income: 480000
Tax Due: 143689.5

```
To calculate the federal income tax based on the provided progressive tax brackets, we first define the mathematical structure of the system and then apply it to the specific income provided.

### **i) Mathematical Model for Annual Income Tax**

Let $x$ represent the **annual taxable income**. The total annual income tax $T(x)$ is a piecewise function. To build this model, we calculate the cumulative tax paid at the top of each bracket:

* **Bracket 1 (10%):** $9,525 \times 0.10 = \$952.50$
* **Bracket 2 (12%):** $952.50 + (38,700 - 9,525) \times 0.12 = \$4,453.50$
* **Bracket 3 (22%):** $4,453.50 + (82,500 - 38,700) \times 0.22 = \$14,089.50$
* **Bracket 4 (24%):** $14,089.50 + (157,500 - 82,500) \times 0.24 = \$32,089.50$
* **Bracket 5 (32%):** $32,089.50 + (200,000 - 157,500) \times 0.32 = \$45,689.50$
* **Bracket 6 (35%):** $45,689.50 + (500,000 - 200,000) \times 0.35 = \$150,689.50$

**The Piecewise Mathematical Model $T(x)$:**

$$T(x) = 
\begin{cases} 
0.10x & 0 \le x \le 9,525 \\
952.50 + 0.12(x - 9,525) & 9,525 < x \le 38,700 \\
4,453.50 + 0.22(x - 38,700) & 38,700 < x \le 82,500 \\
14,089.50 + 0.24(x - 82,500) & 82,500 < x \le 157,500 \\
32,089.50 + 0.32(x - 157,500) & 157,500 < x \le 200,000 \\
45,689.50 + 0.35(x - 200,000) & 200,000 < x \le 500,000 \\
150,689.50 + 0.37(x - 500,000) & x > 500,000 
\end{cases}$$

---

### **ii) Calculation for Monthly Taxable Income of $40,000**

**Step 1: Determine Annual Taxable Income**
$$\text{Annual Income } (x) = \$40,000 \times 12 = \$480,000$$

**Step 2: Identify the Tax Bracket**
The income of $\$480,000$ falls into the **35% bracket** ($200,001$ to $500,000$).

**Step 3: Apply the Model**
Using the corresponding piece of the function:
$$T(480,000) = 45,689.50 + 0.35(480,000 - 200,000)$$
$$T(480,000) = 45,689.50 + 0.35(280,000)$$
$$T(480,000) = 45,689.50 + 98,000$$
$$T(480,000) = \$143,689.50$$

**Final Result:**
If your monthly taxable income is $\$40,000$, your total annual federal income tax would be **$\$143,689.50$**.