# evaluating an indefinite integral with tangent function

I'm studying for finals, and I'm having a problem with this integral:

$$\int\tan(7x+1)dx$$

I simplified it to $$\int \frac {\sin(7x+1)}{\cos(7x+1)} dx .$$

I then substituted $\cos(7x+1)$ by $u$, and $$\frac {du}{dx}=-\sin(7x+1) .$$ This results in $-du = sin(7x+1)$. I then substituted, and got $$-1\int\frac {du}{u}$$ and integrated to get $$-\ln(u)+C .$$ I then plugged the original value of $u$ back in, and got $$-\ln(\cos(7x+1) .$$ However, my program says that this is incorrect.

Can someone please point out my error? Thanks!

• Your $du/dx$ is wrong -- you're missing one of the factors from the chain rule. Dec 13 '15 at 0:51
• DOH! I feel like an idiot, thanks for pointing that out Dec 13 '15 at 0:52

$$\int\tan\left(7x+1\right)\space\text{d}x=$$

Substitute $u=7x+1$ and $\text{d}u=7\space\text{d}x$:

$$\frac{1}{7}\int\tan\left(u\right)\space\text{d}u=$$ $$\frac{1}{7}\int\frac{\sin(u)}{\cos(u)}\space\text{d}u=$$

Substitute $s=\cos(u)$ and $\text{d}s=-\sin(u)\space\text{d}u$:

$$-\frac{1}{7}\int\frac{1}{s}\space\text{d}s=$$ $$-\frac{\ln\left|s\right|}{7}+\text{C}=$$ $$-\frac{\ln\left|\cos(u)\right|}{7}+\text{C}=$$ $$-\frac{\ln\left|\cos(7x+1)\right|}{7}+\text{C}$$