Piecewise Integration: Definition & Examples

Instructor: Matthew Bergstresser

Matthew has a Master of Arts degree in Physics Education

Integration is finding the area between a function and the x-axis. Piecewise functions have separate expressions based on x-axis conditions. In this lesson, we'll learn how to integrate piecewise functions.

Piecewise Functions

While some restaurants let you have breakfast any time of the day, most places serve breakfast, lunch, then dinner at different times. The different meals they serve depend on the time of the day. Likewise, there are functions that have different expressions based on where they are to be evaluated on the x-axis. These are called piecewise functions. Instead of times of the day determining which foods are available, we have a menu of functions that are available based on different values of x along the horizontal axis.

Before we cover a few examples of how to integrate piecewise functions, there are some steps that can help keep things going smoothly. These steps are just to keep you from mixing up breakfast and dinner, and for making sure that you're working with the right expressions of piecewise functions for different x values:

  1. Break your piecewise integration into two separate integrals based on the boundaries of the definite integral: If you're having trouble seeing it, try using a number line to visualize which expression applies based on the x-values.
  2. Evaluate each integral on its own then add the results.

That's it! As long as you know how to integrate a function and keep close track of your x-values, you should be in good shape. Okay, let's work through a few examples.

Example 1

Example 1 shows a piecewise function.

Example 1

In Example 1, for x < 1, the expression is 1 + x. For x ≥ 1, the expression is x2. We can integrate this function piecewise by using separate definite integrals with the corresponding expressions. Let's start by integrating Example 1 piecewise between − 1 and 3.

We start with a general expression for our definite integral, which is


We can break this into two separate integrals based on the boundaries of the definite integral. Let's use a number line to identify which expression applies based on the x-values.


Looking at the number line, we see how we can set up two integrals based on the x-boundaries. We're going to go from x = − 1 to x = 1 for the first expression, then we continue to the next expression from x = 1 to x = 3. The piecewise integrals are


We evaluate these integrals and then add the results. Let's evaluate the first integral. We start by integrating the function in preparation for evaluating the result between − 1 and 1. This gives us


Now we evaluate the equation between the boundaries giving


Now we can complete the second integral in preparation to evaluate it between 1 and 3. This results in


Evaluating this integral we get


Now we add both results together to get the final answer, which is


Example 2

Let's work another example of piecewise integration. This time we will deal with a piecewise function involving two trigonometric functions. The piecewise function is shown in Example 2.

Example 2

Let's evaluate this function between -π and 2π. The general expression for this problem is


It is helpful to set up the number lines to see which function applies between the boundaries so we can break it up.


The piecewise integral setup is


To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account