Checking the approach for solving the integral I am trying to show that $\int_{a}^{b} \frac{f'(x)}{f^2(x)} dx = \frac{f(b) -f(a)} {f(a) f(b)}$ given that $f(x)$ is, continuous in $[a,b]$, differentiable in $(a,b)$ and $f(x) \neq 0$ in $[a,b]$.
New Edit :  i have understood my doubt answer from this post https://math.stackexchange.com/a/470460/961436 , but now a question arise is if we are asked to show the proof of the above integration, we will take help of fundamental theorem of calculus with compositon rule ?like as done in there , because otherwise if i do like what i was taught as in below old method of mine it would cause confusion that  whether i was supposing it to be injective or not ? Or the below proof is fine in its own way ? ,

My steps: I was taught this method so I am writing this down letting $f(x) = t$ we have $f'(x)dx=dt$ substituting this in the integrand and changing the limits we arrived at $\int_{f(a)}^{f(b)} \frac{1}{t^2} dt$ which by knowing that $\int x^ndx$ = $\frac{x^{n+1}}{n+1} + C$ gives the required result. My query is in the substitution used, as such we want the integration when $x$ goes from $a$ to $b$, so we need to integrate at all possible values of $x$ lying between $a$ and $b$, but how are we sure that the substitution will give the same range of $x$ for which the integral is being evaluated, its not given as such that $f(x)$ is injective in $[a,b]$ so how can we do such substitution? Or this approach is not correct therefore?


*

*Like the case of $f(x) = (x-2) ^2 + 1 $, from $[1,4]$, we can observe its not injective at all, but still the integration of                 $\frac{2(x-2)}{({x-2})^2 + 1 }$ integrated from $1$ to $4$, gives the correct answer as $0.3$, I am not gettting at all why as such.

 A: There are two parts to the Fundamental Theorem, the second one (according to p.384 of Stewart's Calculus 6E) states:

"If $f$ is continuous on $[a,b]$, then $$\int_a^bf(x)dx = F(b)-F(a)$$ where $F$ is any antiderivative of $f$, that is, a function such that $F'=f$."

We want to show: $$\int_a^b\frac{f'(x)}{f^2(x)}dx = \frac{f(b)-f(a)}{f(a)f(b)}.$$
given the assumptions that $f$ is continuous on $[a,b]$, differentiable on $(a,b)$ and nonzero. 
These technical assumptions give us that the integrand is continuous on $[a,b]$ (as it is the quotient of nonzero continuous functions). Hence we should expect the RHS to be in terms of an antiderivative.  
Guessing the form:
$$F(x):= \frac{f(x)-f(x_0)}{f(x_0)f(x)}$$
(for some fixed $x_0\in [a,b]$) we may deduce that:
$$F(b)-F(a) = \frac{f(b)-f(x_0)}{f(x_0)f(b)} - \frac{f(a)-f(x_0)}{f(x_0)f(a)} = \frac{f(b)-f(a)}{f(a)f(b)}.$$
If we can show this guess is actually an antiderivative, the theorem provides the equality and we're done. 
Accordingly,
$$F'(x) = \frac{d}{dx}\bigg[\frac{f(x)-f(x_0)}{f(x_0)f(x)}\bigg] = \frac{d}{dx}\bigg[\frac{1}{f(x_0)} - \frac{1}{f(x)}\bigg]$$
$$ = \frac{d}{dx}\bigg[\frac{1}{f(x_0)}\bigg] - \frac{d}{dx}\bigg[\frac{1}{f(x)}\bigg] = 0 - \bigg[\frac{-1}{f^2(x)}\cdot f'(x)\bigg] = \frac{f'(x)}{f^2(x)},$$
by linearity of $\frac{d}{dx}$, the power rule and chain rule. $\blacksquare$
