This integral is discussed in most calculus books. I will write a detailed solution, because thinking about this integral gives a good workout in techniques of integration.
You have already been told about the useful identity
$$1+\tan^2 x=\frac{1}{\cos^2 x}.$$
You may have seen this identity as
$$1+\tan^2x =\sec^2 x.$$
There are slightly tricky things about taking square roots, but they are not a problem in the interval where you are working. We end up wanting to find
$\int \sec x dx$, or equivalently $\int dx/(\cos x)$.
The strategy we will use is one that is useful when we are integrating a combination of powers of $\sin x$ and $\cos x$, with one of the powers odd.
Rewrite the integral as
$$\int \frac{\cos x}{\cos^2 x}dx = \int \frac{ \cos x}{1 -\sin^2 x}dx.$$
Make the substitution $u=\sin x$. Then $du=\cos x dx$.
So now our indefinite integral is
$$\int \frac{du}{1-u^2}.$$
It is more convenient to make the substitution in the "limits" of integration. When $x=\pi/4$, we have $u=1/\sqrt{2}$ and when $x=0$, we have $u=0$, so we want
$$\int_{u=0}^{\pi/4} \frac{du}{1-u^2}.$$
Our integral is now in perfect shape for the method of "partial fractions." By going through the machinery of partial fractions, or by inspection, we have
$$\frac{1}{1-u^2}=\frac{1}{1-u^2}=\frac{1/2}{1-u}+\frac{1/2}{1+u}.$$
We have arrived at
$$\int_0^{1/\sqrt{2}} \left(\frac{1/2}{1-u}+\frac{1/2}{1+u}\right)du.$$
Finally, everything is easy. By substitution, or by inspection, we have
$$\int\frac{1/2}{1-u}du=-(1/2)\ln(|1-u|) +C \qquad\text{and}\qquad \int\frac{1/2}{1+u}du=(1/2)\ln(|1+u|) +C.$$
(We don't have to worry about the constant of integration, since now we will be substituting the limits.)
If we are in the mood, we can combine things, using the properties of logarithms, to conclude that the indefinite integral is
$$\frac{1}{2}\ln\left(\left|\frac{1+u}{1-u}\right|\right)+C.$$
A lot of work! But at least we got to practice a lot of techniques of integration. The integral $\int \sec x dx$ is one of the nastiest ones that one is likely to meet. Actually, it does show up in real applications.
A magic way: We want
$$\int \sec x dx.$$
Multiply "top" and "bottom" by $\sec x +\tan x$. We get
$$\int \frac{\sec^2 x +\sec x\tan x}{\sec x+\tan x}dx.$$
Let $u=\sec x+\tan x$. Then from standard (?) differentiation formulas, we have
$$du =\sec x\tan x+\sec^2 x.$$
Note that this is more or less exactly what we have on top.
So our indefinite integral simplifies to
$$\int \frac{du}{u}=\ln |u| +C$$
and it's over.
Why the magic substitution? Because it works, and I happen to remember it. However, the slow, systematic procedure that was the first one discussed is the one you should concentrate on.
And there are a number of other approaches to the integral!