# Integrating a piecewise function?

• MHB
• Emma_011
In summary, the conversation discusses finding the values of g(1) and g(5) given a graph and the involvement of area. The value of g(1) is determined by subtracting the area above the x-axis (between x=-5 and x=0) from the area below the x-axis (between x=0 and x=1). For g(5), the negative area between x=0 and x=4 is subtracted from the positive area between x=-5 and x=0. The output for g(5) is then determined using the basic rule of integration.
Emma_011

I have to find:

g(1)=
and
g(5)=

I have drawn the graph and I am a little unsure where to go from there. I know area is involved somehow but not entirely sure what to do. Any help is appreciated

Emma_011 said:
View attachment 10849

I have to find:

g(1)=
and
g(5)=

I have drawn the graph and I am a little unsure where to go from there. I know area is involved somehow but not entirely sure what to do. Any help is appreciated
Welcome to MHB Emma! ;)

We have a rectangular area between x=-5 and x=0 in the graph that is above the x-axis.
What is its area?
We have another rectangular area between x=0 and x=1 that is below the x-axis.
What is its area?

The value of g(1) is the area above the x-axis (starting from x=-5) minus the area below the x-axis (up to x=1). Can you find it?

Last edited:
Based on what is given, the area would be 20 between x=-5 and x=0 and the area between x=0 and x=1 would be 5.

So it would be 20-5=15

Emma_011 said:
Based on what is given, the area would be 20 between x=-5 and x=0 and the area between x=0 and x=1 would be 5.

So it would be 20-5=15
Yep. (Nod)

For g(5) the negative area runs from x=0 to x=4.
After that we have zero (up to x=5), so there is no area there to add or subtract.
Can we find g(5) then?

Since there is no area to add or subtract would it just be 0?

Emma_011 said:
Since there is no area to add or subtract would it just be 0?
No, only the part to the right of x=4 is zero.
We still have the positive rectangle between x=-5 and x=0, an the negative rectangle between x=0 and x=4.
So g(5) is the difference between the areas of those two rectangles.

Frankly, I wouldn't have thought of this as "area" at all but just use the basic rule of itegration: $\int_a^b f(x)dx= \int_a^c f(x)dx+ \int_c^b f(x)dx$.

$g(x)= \int_{-5}^x f(x)dx$ is:
if $x\le -5$, $g(x)= \int_{-\infty}^x 0 dx= 0$
if $-5\le x\le 0$ $g(x)= \int_{-5}^x 4dx= \left[4x\right]_{-5}^x= 0- 4x= -4x$
if $0\le x\le 4$ $g(x)= \int_{-5}^0 4dx+ \int_0^x -5 dx= -4(-5)+ \left[-5x\right]_0^x= 20+ -5x- 0= 20- 5x$
if $x\ge 5$ $g(x)= \int_{-5}^4 f(x)dx+ \int_4^5 0 dx= 20- 5(4)= 0$.

Last edited:

## 1. What is a piecewise function?

A piecewise function is a mathematical function that is defined by different equations on different intervals. This means that the function may have different rules or formulas for different parts of its domain.

## 2. How do you integrate a piecewise function?

To integrate a piecewise function, you first need to find the integral for each piece of the function separately. Then, you can combine the integrals using the appropriate limits of integration for each piece.

## 3. What are the benefits of using piecewise functions?

Piecewise functions allow for more flexibility in representing real-world situations that may have different rules or behaviors in different scenarios. They also make it easier to work with complex functions by breaking them down into smaller, more manageable pieces.

## 4. Can piecewise functions be used in any type of mathematical problem?

Yes, piecewise functions can be used in a variety of mathematical problems, including calculus, algebra, and geometry. They are particularly useful in problems involving optimization, modeling, and real-world applications.

## 5. Are there any common mistakes to avoid when integrating a piecewise function?

One common mistake when integrating a piecewise function is forgetting to change the limits of integration for each piece. It is important to make sure that the limits match the interval for each piece of the function. Additionally, it is important to check for continuity at the points where the pieces of the function meet to ensure a smooth and accurate integration.

• Calculus and Beyond Homework Help
Replies
9
Views
1K
• Calculus
Replies
8
Views
903
• Calculus
Replies
5
Views
2K
• Calculus
Replies
6
Views
2K
• Calculus
Replies
2
Views
2K
• Calculus
Replies
8
Views
2K
• Calculus
Replies
3
Views
2K
• Calculus
Replies
20
Views
3K
• Calculus
Replies
31
Views
2K
• Calculus
Replies
7
Views
1K