Integral of Piecewise Function Calculator

Analyze piecewise intervals, constants, and polynomials confidently. See segment contributions, antiderivative steps, and totals clearly. Compare interval areas instantly before exporting polished results anywhere.

Calculator Inputs

Use ordered, non-overlapping domains. Trigonometric inputs use radians. Constant segments use coefficient C. Exponential segments use A, B, and C. Sine and cosine use A, B, C, and D.

Constant: C Linear: Ax + B Quadratic: Ax² + Bx + C Cubic: Ax³ + Bx² + Cx + D Exponential: Ae^(Bx) + C Sine/Cosine: A·trig(Bx + C) + D

Segment 1

Domain piece

Segment 2

Domain piece

Segment 3

Domain piece

Segment 4

Domain piece

Segment 5

Domain piece

Segment 6

Domain piece

Example Data Table

Segment Domain Type Example Expression Example Overlap for [-3, 4]
1 [-4, -1] Linear 2x + 1 [-3, -1]
2 [-1, 2] Quadratic x² - 1 [-1, 2]
3 [2, 5] Sine 2sin(x) [2, 4]

This sample mirrors the default values already loaded into the form, so you can test the calculator immediately.

Formula Used

Total definite integral across a piecewise function

I = Σ ∫ from max(A, Li) to min(B, Ui) of fi(x) dx

Average value over the full requested interval

Average value = I / (B - A)

Approximate absolute area

Absolute area ≈ Σ ∫ |fi(x)| dx using the trapezoidal method on each overlapping segment.

Supported antiderivatives

  • c → cx
  • ax + b → (a/2)x² + bx
  • ax² + bx + c → (a/3)x³ + (b/2)x² + cx
  • ax³ + bx² + cx + d → (a/4)x⁴ + (b/3)x³ + (c/2)x² + dx
  • ae^(bx) + c → (a/b)e^(bx) + cx when b ≠ 0
  • a sin(bx + c) + d → -(a/b)cos(bx + c) + dx when b ≠ 0
  • a cos(bx + c) + d → (a/b)sin(bx + c) + dx when b ≠ 0

How to Use This Calculator

  1. Enter the lower and upper bounds for the interval you want to integrate.
  2. Choose how many segments are active, then define each domain in ascending order.
  3. Select the function type for each segment and fill in its coefficients A, B, C, and D as needed.
  4. Press Submit to see the total integral, overlap details, graph, and downloadable report files.

FAQs

1. What does this calculator integrate?

It integrates a function built from ordered segments, where each interval can use a different rule such as constant, linear, quadratic, cubic, exponential, sine, or cosine.

2. What happens if my interval crosses several segments?

The calculator splits the requested interval automatically. It finds the overlap inside each active segment, computes each definite integral separately, and then sums the contributions.

3. Do active segment domains need to touch each other?

No. Gaps are allowed. Any uncovered portion inside the requested integration range contributes zero, and the result panel reports the uncovered length clearly.

4. Why is absolute area different from the definite integral?

The definite integral keeps signs, so positive and negative contributions can cancel. Absolute area removes sign before accumulating, which shows total magnitude instead of net change.

5. Are trigonometric inputs treated as degrees?

No. Sine and cosine terms use radians for the internal calculations. Convert degree-based angles to radians before entering frequency or phase-related values.

6. Can I integrate only part of one segment?

Yes. If the requested interval covers only a fraction of a segment, the calculator trims that segment to the overlapping section and integrates only that part.

7. Why does the graph still show full segment domains?

The main curve displays each active segment across its declared domain. A second filled trace highlights the area that actually falls inside the chosen integration interval.

8. What do the CSV and PDF files contain?

They include the key summary values and the segment-by-segment result table, which helps with review, documentation, coursework, or reporting.

Related Calculators

trigonometric integral calculatorintegral bounds calculatorantiderivative calculatoronline integral solverintegral approximation calculatorintegral with limits calculatormultiple integral calculatorsymbolic integral calculatorcontour integral calculatorarc length integral calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.