Why we get area under curve of definite integral between limits where function goes to infinity using substitution method.
e.g : $$ \int_{0}^{\pi} \sec(x).\tan(x) \space dx $$ Function goes to infinity between these limits.why we get area under curve?
I will try to give some background here, hope this will help the OP to understand what is going on with this curve and this integral.
First, "area under curve" is a vague concept until defined rigorously. Let's not get into the intricacies of Jordan measure and Lebesgue measure, but if the curve is defined by a non-negative function $f:[a,b]\to\mathbb R$, then it turns out that:
As it happens, Riemann integral is simpler to teach (and is so usually introduced first to students), but is more restricted in terms of when it can be calculated. For one thing, it requires the function to be bounded, which your function certainly isn't. (Your function is $f(x)=\sec x\cdot\tan x=\frac{\sin x }{\cos^2 x}$ and, as you've noticed, $\lim_{x\to\pi/2}f(x)dx=+\infty$). You can still use Lebesgue integral, or you can use the sum of the improper Riemann (or Lebesgue) integrals: $\int_0^{\pi/2-0}f(x)dx+\int_{\pi/2+0}^\pi f(x)dx$. Both approaches can be proven to give you the same result.
Now, as $\frac{1}{\cos x}$ is the primitive function of your function, it follows that $\int_a^b \frac{\sin x}{\cos^2 x}dx=\frac{1}{\cos x}\mid_a^b=\frac{1}{\cos b}-\frac{1}{\cos a}$ on any interval where your function is defined and Riemann-integrable (Fundamental theorem of Calculus). This precludes intervals such as $[0,\pi]$, but still lets us calculate the improper integrals:
$$\int_0^{\pi/2-0}f(x)dx=\lim_{b\to\pi/2-0}\left(\frac{1}{\cos b}-\frac{1}{\cos 0}\right)=+\infty$$ $$\int_{\pi/2+0}^\pi f(x)dx=\lim_{a\to\pi/2+0}\left(\frac{1}{\cos \pi}-\frac{1}{\cos a}\right)=+\infty$$
and so, by adding up those two numbers, the final integral diverges, i.e. its value is $+\infty$, which also means that the area under the curve is infinite.
(At least, this happens with the function from your question... You can think of another function, say $f(x)=\frac{\sin x}{\sqrt{|\cos x|}}$, for which the improper integrals would be finite and their sum would give you a finite "area under curve" - give it a try!)
Note a common mistake one can make: to calculate
$$\int_0^\pi f(x)dx=\frac{1}{\cos x}]_0^\pi=\frac{1}{\cos \pi}-\frac{1}{\cos 0} = 1-1 = 0$$
This is obviously not just incorrect but doesn't make any sense (as the curve is obviously "above" the $x$-axis, the area "under" it cannot end up being zero!), but as pointed above the mistake is that one has used the Fundamental theorem of Calculus on an interval where that theorem does not apply.