Integration with trig substitution Trying to evaluate this using trig substitution:
$$\int \frac {1}{49x^2 + 25}\mathrm{d}x $$
Here's how I'm going about it, using $x = 5/7(\tan\theta)$
$$\int \frac {1}{49\left(x^2 + \frac{25}{49}\right)}\mathrm{d}x $$
$$=\int \frac {1}{49\left(\frac{25}{49}\tan^2\theta + \frac{25}{49}\right)} \mathrm{d}\theta$$
$$=\int \frac {1}{(25\tan^2\theta + 25)} $$
$$=\int \frac {1}{25(\tan^2\theta + 1)}\mathrm{d}\theta $$
$$=\int \frac {1}{25\sec^2\theta}\mathrm{d}\theta $$
$$=\int \frac {\cos^2\theta}{25}\mathrm{d}\theta $$
$$=\frac{1}{50}(\theta + \sin\theta + \cos\theta) $$
To generalize for $x$, $\theta = \arctan(7x/5)$
$$\frac{1}{50}\left(\arctan\left(\frac{7x}{5}\right) + \sin\left(\arctan\left(\frac{7x}{5}\right)\right) + \cos\left(\arctan\left(\frac{7x}{5}\right)\right)\right) $$
$$\frac{1}{50} \left(\frac{7x}{5\left(\frac{49x^2}{25}+1\right)} + \arctan\left(\frac{7x}{5}\right)\right)$$
But taking the derivative of this gets me:
$$ \frac{35}{(49x^2 +25)^2}$$
Where is my mistake?

We can calculate a more general integral of the form
$$I =\int\frac{1}{a^2x^2+b^2}\,\mathrm{d}x.$$
In your example $a=7$ and $b=5$. First of all do the non-trigonometrical substitution $u=ax/b$. That will give you
$$\int\frac{b}{a(b^2u^2+b^2)}\,\mathrm{d}x=\frac{1}{ab}\int\frac{1}{u^2+1}\,\mathrm{d}u.$$
You should be familiar with this integral. It's equal to $\arctan u$. Substituting back yields
$$I = \dfrac{\arctan(ax/b)}{ab}+C.$$
