# Definite integrals using u substitution (verification needed)

Would someone mind verifying this?

$\int_{0}^{\ln(\pi + 1)}e^x \sin(e^x - 1) \space dx$

$u = e^x - 1 \Rightarrow \frac{du}{dx} = e^x \Rightarrow du = e^x \space dx \Rightarrow dx = \frac{1}{e^x} \space du$

$\int_{0}^{\ln(\pi + 1)} e^x \sin(u) \frac{1}{e^x} \space du = \int_{0}^{\ln(\pi + 1)} \sin(u) \space du = -\cos(u) \space |_{0}^{\ln(\pi + 1)} = -\cos(e^x - 1) \space |_{0}^{\ln(\pi + 1)} = [-\cos(e^{\ln(\pi + 1)} - 1)] - [-\cos(e^{0} - 1)] = [-\cos(\pi + 1-1)] - [-\cos(1 - 1)] = [-\cos(\pi)] - [-\cos(0)] = -\cos(\pi) + 1$

and a second one

$\int_{\frac{\pi^2}{4}}^{\pi^2}\frac{\cos(\sqrt{x})}{\sqrt(x)} \space dx \\$

$u = \sqrt{x} \Rightarrow \frac{du}{dx} = \frac{1}{2 \sqrt{x}} \Rightarrow du = \frac{1}{2 \sqrt{x}} \space dx \Rightarrow dx = \frac{du}{\frac{1}{2 \sqrt{x}}} = 2\sqrt{x} \space du$

$\int_{\frac{\pi^2}{4}}^{\pi^2} = \frac{\cos(u)}{\sqrt(x)} 2\sqrt{x} \space du = 2 \int_{\frac{\pi^2}{4}}^{\pi^2} \cos(u) \space du = 2\sin(\sqrt{x}) \space |_{\frac{\pi^2}{4}}^{\pi^2}$

$= 2\sin(\sqrt{x}) \space |_{\frac{\pi^2}{4}}^{\pi^2} = [2\sin(\sqrt{\pi^2})] - [2\sin(\sqrt{\frac{\pi^2}{4}})] = [2\sin(\pi)]-[2\sin\frac{\pi}{2}] = [2(0)]-[2(1)] = 0 - 2 = -2$

(Thanks. :))

-
I don't really understand the downvote on this, OP has done work and only wants us to check his solution. Provided he could check it on wolfram or another program, but still – Jean-Sébastien Nov 10 '12 at 17:11
The equals sign in $$\int_{\frac{\pi^2}{4}}^{\pi^2}=\frac{\cos(u)}{\sqrt(x)}2\sqrt{x}~du$$ is incorrect; it’s a bit like writing $\sqrt~=2$ when you mean $\sqrt2$. @Nameless: You do the OP no favor by correcting a significant notational error without explaining it in a comment. Fortunately, you missed this one. – Brian M. Scott Nov 10 '12 at 17:27
I assumed it was a latex error, not a significant notational one. Next time I will make sure to comment whenever I edit such mistakes. – Nameless Nov 10 '12 at 17:31
Brian, Nameless, Sorry about the equal sign, it was just a glitch that sneaked it's way in there when typing in the LaTeX. Just want to say thanks to everyone for feedback. Wish I could give more than 1 correct answer. I have gone back and watched a PatrickJMT video and corrected my mistakes. :) – jiku Nov 10 '12 at 18:58
@Jean-Sébastien, Thanks. I posted it here because I have a hard time making sense of Wolfram step-by-step sometimes. – jiku Nov 10 '12 at 18:59

You need to be careful with your limits of integration. In general, if you're doing a $u$-substitution to solve a definite integral, there are two potential ways to deal with the limits of integration:

(2) Don't worry about them initially. Get an antiderivative in terms of $u$, then switch back to the original variable and apply Fundamental Theorem of Calculus.

For an example, let's consider the simple one $\int_2^3xe^{x^2}\,dx$, with the substitution $u=x^2$. In either case, we have $\frac{du}{dx}=2x$, so $du=2x\,dx$, and so $x\,dx=\frac12\,du.$ (Note that I didn't solve for $dx$, here, but rather for $x\,dx$, which are the extraneous $x$-terms when we make the substitution $e^{x^2}\mapsto e^u$ in the original integrand.)

Using method (1), $x=2$ implies $u=2^2=4$, and $x=3$ implies $u=3^2=9$. Hence, $$\int_2^3xe^{x^2}\,dx=\frac12\int_4^9e^u\,du=\frac12\left[e^u\right]_{u=4}^9=\frac12(e^9-e^4).$$

Using method (2), $$\int xe^{x^2}\,dx=\frac12\int e^u\,du=\frac12e^u=\frac12e^{x^2}.$$ (Since we're about to apply the FTC, we don't need an integration constant, here.) Thus, by FTC, we have $$\int xe^{x^2}\,dx=\left[\frac12e^{x^2}\right]_{x=2}^3=\frac12(e^9-e^4).$$

Pick whichever method works for you, and stick with it. (I recommend the first one, personally.) You seem to be favoring the latter. However, you must be cautious with the notation. $\int_0^{\ln(\pi+1)}e^x\sin(e^x-1)\,dx\neq\int_0^{\ln(\pi+1)}\sin u\,du$, for example. As a potential alternative, you could write $$\int_0^{\ln(\pi+1)}e^x\sin(e^x-1)\,dx=\int_{x=0}^{\ln(\pi+1)}\sin u\,du,$$ to make clear that the latter limits of integration are on the variable $x$.

-
Thanks very much for the walk-through. I'll try to adapt the first method, seems cleaner in the end. :) – jiku Nov 10 '12 at 19:03

When you were doing the u subsitution, why did you bring the e^x to the du side? When subsituting, you want to eliminate all functions of x and change them into a function in terms of u. Also you will get a new interval when making u-substitutions!

-
for the second part, you are making this error as well – tamefoxes Nov 10 '12 at 16:59

You arrived at the correct results in a rather unusual way. Here is how it should be: $u = e^x- 1\Rightarrow \frac{du}{dx} = e^x\Rightarrow du = e^x \space dx$ and $0\le x\le\ln(\pi + 1)\Rightarrow 0\le u\le \pi$ Therefore, \begin{gather} \int_{0}^{\ln(\pi + 1)} e^x \sin(e^x-1) \space dx = \int_{0}^{\pi} \sin(u) \space du = -\cos(u) \space |_{0}^{\pi} = [-\cos(\pi)] - [-\cos(0)] = 1+1=2 \end{gather}

-