# Math Help - U-substitution check

1. ## U-substitution check

Problem:
$\int\frac{sin(x)}{cos(x)}*dx$ from 0 to $\pi/4$

Attempt:
$u = cos(x)$
$du = -sin(x) dx$
$dx = \frac{du}{-sin(x)}$
$\int\frac{sin(x)}{-sin(x)*u}*du$

$-\int\frac{du}{u}$

$-\int\frac{du}{u} = -ln|u|$

$-ln|cos(x)|$

$-ln|cos(\pi/4)| + ln|cos(0)|$

$-ln(\frac{\sqrt{2}}{2})$

$
\frac{ln|2|}{2}
$

Can someone tell me where I went wrong?

2. You didn't do anything wrong. They're the same answer.

$-\ln\left|\frac{\sqrt{2}}{2}\right| = -\ln\left|\frac{1}{\sqrt{2}}\right| = -\ln\left|2^{-1/2}\right| = -\frac{1}{2}\cdot-\ln|2| = \frac{\ln|2|}{2}$

3. Edit: Might as well have read the whole post. $-ln|\frac {\sqrt 2}{2}| = ln|\sqrt 2| = 1/2ln|2|$

$\int \frac{sinx}{cosx}dx$

u = cosx
du = -sinxdx

$\int \frac{du}{u} = ln|u|$

$-\int \frac{du}{u} = -ln|cosx|$