# How to Integrate x(e^x)cos(x) and x(e^x)sin(x)

The method of integration by parts can be used to find the antiderivatives of two-product functions such as x*cos(x), x*e^x, and (e^x)cos(x), but what about the triple product of a polynomial, trig function and exponential function? How do you integrate function such as x*cos(x)*e^x and x*sin(x)*e^x? Is there an integration by parts formula for the product of three functions? In fact, there is. If you have the integral

∫ f(x)*g(x)*h* '*(x) dx

then you can reduce the integral to a simpler form with the reduction equation

∫ f(x)*g(x)*h* '*(x) dx = f(x)g(x)h(x) - ∫ f(x)*g

*(x)*h(x) dx - ∫ f*

**'***(x)*g(x)*h(x) dx*

**'**With several applications of this integral reduction formula you can work out the antiderivative of the product of a linear function, trig function, and exponential function.

## Integration by Parts Formula for Three Functions

## Integrals of x*cos(x)*e^x and x*sin(x)*e^x : Circular Method

For the function y = x*cos(x)*e^x, we will use the assignment f(x) = x, g(x) = cos(x), and h* '*(x) = e^x. This gives us f

*(x) = 1, g*

**'***(x) = -sin(x), and h(x) = e^x. Plugging these various pieces into the integration by parts formula gives us*

**'**∫ x*cos(x)*e^x dx

= x*cos(x)*e^x - ∫ cos(x)*e^x dx + ∫ x*sin(x)*e^x dx

= x*cos(x)*e^x - 0.5cos(x)*e^x - 0.5sin(x)*e^x + ∫ x*sin(x)*e^x dx

The integral of cos(x)e^x was worked out in a previous tutorial, linked above. The equation above gives the integral of x*cos(x)*e^x in terms of the integral of x*sin(x)*e^x. So now we must apply the triple integration by parts formula to the second one, which gives us

∫ x*sin(x)*e^x dx

= x*sin*e^x - ∫ sin(x)*e^x dx - ∫ x*cos(x)*e^x dx

= x*sin(x)*e^x + 0.5cos(x)*e^x - 0.5sin(x)*e^x - ∫ x*cos(x)*e^x dx

Again we get one integral in terms of the other, so it seems like we can only go around in circles. But let's see what happens when we substitute this expression in for the integral of x*sin(x)*e^x in the first equation. This gives us

∫ x*cos(x)*e^x dx =

x*cos(x)*e^x - 0.5cos(x)*e^x - 0.5sin(x)*e^x + x*sin(x)*e^x +

0.5cos(x)*e^x - 0.5sin(x)*e^x - ∫ x*cos(x)*e^x dx

If we bring the integral terms to one side of the equation and solve for the integral using simple algebra, we get

**∫ x*cos(x)*e^x dx = ****(1/2)[ x*sin(x)*e^x + x*cos(x)*e^x - sin(x)*e^x ] + c**

Similarly, we can use simple algebra to solve for the complementary integral

**∫ x*sin(x)*e^x dx = ****(1/2)[ x*sin(x)*e^x - x*cos(x)*e^x + cos(x)*e^x ] + c**

## Related Integrals

You can use the method above to compute more general integrals of functions of the form

y = (ax + b)cos(kx)e^(rx)

y = (ax + b)sin(kx)e^(rx)

which are the products of a linear function, trigonometric function, and exponential function. You can also use the circular integration by parts trick to find the antiderivatives of similar functions involving higher degree polynomials, such as

y = (x^2)cos(x)e^x

y = (x^3)sin(x)e^x

In general, if P(x) is a polynomial function of x, then the antiderivative of P(x)cos(x)e^x and P(x)sin(x)e^x will be of the form

Q(x)cos(x)e^x + R(x)sin(x)e^x

where Q(x) and R(x) are polynomials of the same degree as P(x).

## Integration Example

Find the exact area under the curve y = x*cos(x)*e^x from x = 0 to x = π/2, shown in the graph below.

Since the antiderivative of y = x*cos(x)*e^x is 0.5(e^x)[(x-1)sin(x) + x*cos(x)], we simply plug the endpoints x = 0 and x = π/2 into the antiderivative expression and subtract. This gives us

0.5(e^(π/2))[(π/2-1)*1 + (π/2)*0] - 0.5(e^0)[-1*0 + 0*1]

= [π/4 - 1/2]*e^(π/2)

≈ 1.3729.

## More by this Author

- 1
The antiderivatives of sin(x)^3 and cos(x)^3 [also written sin^3 (x) and cos^3 (x)] can be found using a simple trigonometric identity and u-substitution. Some alternative forms of sine cubed and cosine cubed can be...

- 0
The function y = sqrt(a^2 + x^2) is one half of a hyperbola (a two-piece conic section curve) oriented so that the line of symmetry is the y-axis. The integrals of the function y = sqrt(x^2 + 1) and that of the more...

- 8
Two simple functions, sin(x)/x and cos(x)/x, can't be integrated the easy way. Here is how it's done.