Solveeit Logo

Question

Question: Evaluate the following integral: \(I=\int{{{e}^{x}}\left( \cos x-\sin x \right)dx}\)...

Evaluate the following integral: I=ex(cosxsinx)dxI=\int{{{e}^{x}}\left( \cos x-\sin x \right)dx}

Explanation

Solution

We will split the given function in order to simplify it. We will integrate the simplified function using the method of integration by parts, since the integrand will be a product of two types of functions. The formula for integration by parts for functions uu and vv with respect to xx is as follows,
uvdx=uvdx(dudxvdx)dx\int{uvdx}=u\int{vdx}-\int{\left( \dfrac{du}{dx}\cdot \int{vdx} \right)}dx .

Complete step-by-step answer:
The function we have to integrate is ex(cosxsinx){{e}^{x}}(\cos x-\sin x). We will split it in the following manner,
ex(cosxsinx)=excosxexsinx{{e}^{x}}(\cos x-\sin x)={{e}^{x}}\cos x-{{e}^{x}}\sin x
Now, the integral will become
I=ex(cosxsinx)dx =excosxdxexsinxdx\begin{aligned} & I=\int{{{e}^{x}}\left( \cos x-\sin x \right)dx} \\\ & =\int{{{e}^{x}}\cos xdx}-\int{{{e}^{x}}\sin xdx} \end{aligned}
We will first integrate the first term of the above equation. As the first term is a product of the exponential function and a trigonometric function, we will use the method of integration by parts. The formula for integration by parts for functions uu and vv with respect to xx is as follows,
uvdx=uvdx(dudxvdx)dx\int{uvdx}=u\int{vdx}-\int{\left( \dfrac{du}{dx}\cdot \int{vdx} \right)}dx .
Substituting u=cosxu=\cos x and v=exv={{e}^{x}} in the above formula, we get the following,
cosxexdx=cosxexdx[d(cosx)dxexdx]dx\int{\cos x\cdot {{e}^{x}}dx}=\cos x\cdot \int{{{e}^{x}}dx}-\int{\left[ \dfrac{d(\cos x)}{dx}\int{{{e}^{x}}dx} \right]dx}
Simplifying this expression, we get
cosxexdx=cosxexsinxexdx =excosx+exsinxdx\begin{aligned} & \int{\cos x\cdot {{e}^{x}}dx}=\cos x\cdot {{e}^{x}}-\int{-\sin x\cdot {{e}^{x}}dx} \\\ & ={{e}^{x}}\cos x+\int{{{e}^{x}}\sin xdx} \end{aligned}
Now we will substitute this expression in place of the first term of II, we have the following equation,
I=excosx+exsinxdxexsinxdxI={{e}^{x}}\cos x+\int{{{e}^{x}}\sin xdx}-\int{{{e}^{x}}\sin xdx}
Since, the terms with integrals will cancel out, we will get I==excosx+cI=={{e}^{x}}\cos x+c where cc is the integration constant.
Therefore, the value of the integration is I=excosx+cI={{e}^{x}}\cos x+c.

Note: It is important to understand by observing the function how it should be simplified. The simplification should help us realize which method of integration needs to be used. We are aware that the sine function and cosine function are related to each other via differentiation and integration. So, we chose to integrate the function by parts. Application of the formula for integration by parts needs to be done carefully since the second term in it has an integral inside an integral.