# Two methods to integrate?

Are both methods to solve this equation correct?

$$\int \frac{x}{\sqrt{1 + 2x^2}} dx$$

Method One: $$u=2x^2$$ $$\frac{1}{4}\int \frac{1}{\sqrt{1^2 + \sqrt{u^2}}} du$$ $$\frac{1}{4}log(\sqrt{u}+\sqrt{{u} +1})+C$$ $$\frac{1}{4}log(\sqrt{2}x+\sqrt{2x^2+1})+C$$

Method Two $$u=1+2x^2$$ $$\frac{1}{4}\int\frac{du}{\sqrt{u}}$$ $$\frac{1}{2}\sqrt{u}+C$$ $$\frac{1}{2}\sqrt{1+2x^2}+C$$

I am confused why I get two different answers.

Your first method is not correct. I suspect you are trying to use the following result which is not correct in general: $$\int\frac{1}{f(x)}dx = \log f(x)+C.$$

The correct form would be $$\int\frac{f'(x)}{f(x)}dx = \log f(x)+C,$$ which you cannot use in your example because the denominator of your integrand is not a linear function of $x$.

Another one just for fun ;-)

Set $x=\frac{1}{\sqrt 2}\sinh(u)$ then, $$\int^t\frac{x}{\sqrt{1+2x^2}}dx=\frac{1}{ 2}\int^{\text{argsinh}(\sqrt 2 t)}\frac{\cosh(x)\sinh(u)}{\sqrt{1+\sinh^2(u)}}du=\frac{1}{ 2}\int^{\text{argsinh}(\sqrt2 t)}\frac{\cosh(u)\sinh(u)}{\cosh u}du=\frac{1}{ 2}\int^{\text{argsinh}(\sqrt2 t)}\sinh(u)du=\frac{1}{2}\cosh\left(\text{argsinh}(\sqrt 2 t)\right)+C=\frac{1}{2}\sqrt{2t^2+1}+C.$$

But it's not the shortest way to calculate it.

In method 1, you have a mistake. If $$u=2x^2$$ $$x=\frac{\sqrt{u}}{\sqrt{2}}$$ $$dx=\frac{1}{2 \sqrt{2} \sqrt{u}}$$ and $$\int \frac{x}{\sqrt{1 + 2x^2}} dx=\frac{1}{4} \int \frac{du}{\sqrt{u+1}}=\frac{\sqrt{u+1}}{2}$$

In first you have:

$$\frac{1}{4}\int \frac{1}{\sqrt{1+u}}du=\frac{1}{4}log(\sqrt{u}+\sqrt{{u} +1})+C$$

It should be:

$$\frac{1}{4}\int \frac{1}{\sqrt{1+u}}du=\frac{1}{4}\int(1+u)^{-\frac{1}{2}}du=\frac{1}{4}\cdot 2 \sqrt{1+u}+C$$

The second answer is correct. The mistake in the first method is that your computation of the integral (after substitution) is wrong.

It holds:

$\int\frac{x}{\sqrt{1+2x^2}}dx=\frac{1}{4}\int \frac{1}{\sqrt{1+u}}du=\frac{1}{4}\int(1+u)^{-\frac{1}{2}}u=\frac{2}{4} \sqrt{1+u} +C_2=\frac{1}{2}\sqrt{1+2x^2}+C_2$

Why not directly? Since

$$\int\frac1{\sqrt x}dx=\int x^{-1/2}dx=\frac{x^{1/2}}{1/2}+C=2\sqrt x+C$$

we get that for any differentiable (and positive) function $\;f\;$:

$$\int\frac{f'(x)}{\sqrt{f(x)}}dx=2\sqrt{f(x)}+C$$

In our case,

$$f(x)=1+2x^2\;,\;\;f'(x)=4x\implies\int\frac x{\sqrt{1+2x^2}}dx=\frac14\int\frac{(1+2x^2)'}{\sqrt{1+2x^2}}dx=$$

$$\frac14(2)\sqrt{1+2x^2}+C=\frac12\sqrt{1+2x^2}+C$$