Answer
$$y= \frac{2-\pi}{4}x+\frac{\pi^2}{16}$$
Work Step by Step
Given $$y=x \cos ^{2} x, \quad x=\frac{\pi}{4}$$
Since $y(\pi/4)= \pi/8$ and
\begin{align*}
y'&= \frac{d}{dx}\left(x\right)\cos ^2\left(x\right)+\frac{d}{dx}\left(\cos ^2\left(x\right)\right)x\\
&=\cos ^2\left(x\right)-x\sin \left(2x\right)\\
y'\bigg|_{x=\pi/4}&= \frac{2-\pi}{4}
\end{align*}
Then the tangent line equation is given by
\begin{align*}
\frac{y-y_1}{x-x_1}&=m\\
\frac{y- \pi/8}{x-\pi/4} &= \frac{2-\pi}{4}\\
y- \pi/8&= \frac{2-\pi}{4}[x-\pi/4]\\
y&= \frac{2-\pi}{4}x+\frac{\pi^2}{16}
\end{align*}