Calculate the integral using another integral Need help with this integration: 
Let $$A = \int_0^\pi \frac{\cos x}{(x+2)^2}dx$$
Compute $$\int_0^{\frac{\pi}{2}} \frac{\sin x \cos x}{x+1}dx$$
In terms of $A$.
I tried to do some algebraic manipulations but either get something rather complicated or just dead ends. Any help would be great!
 A: Hint: In the second integral, let $x=t/2$. Then $dx=dt/2$, and the second integral is
$$\int_0^\pi \frac{\sin(t/2)\cos(t/2)}{t+2}\,dt.$$
Note that $\sin(t/2)\cos(t/2)$ is $\frac{1}{2}\sin t$.
Now use integration by parts. Let $u=\frac{1}{t+2}$ and $dv=\frac{1}{2}\sin t\,dt$. 
A: In the original integral change variables $x = u/2$
$$
 I=\int_0^{\frac{\pi}{2}} \frac{\sin x \cos x}{x+1}dx = \int_0^{\pi} \frac{\sin(u)}{2(u+2)} \mathrm{d}u
$$
Now integrate by parts:
$$
   I = \left[ -\frac{\cos(u)}{2(u+2)} \right]_{u=0}^{u = \pi} - \frac{1}{2} \int_0^\pi \frac{\cos(u)}{(u+2)^2} \mathrm{d}u = \frac{1}{4} + \frac{1}{2(\pi+2)} - \frac{1}{2} A
$$
A: $$
\begin{align}
\int_0^{\frac\pi2}\frac{\sin(x)\cos(x)}{x+1}\mathrm{d}x
&=\frac12\int_0^{\frac\pi2}\frac{\sin(2x)}{x+1}\mathrm{d}x\tag{1}\\
&=\frac12\int_0^\pi\frac{\sin(x)}{x+2}\mathrm{d}x\tag{2}\\
&=-\frac12\int_0^\pi\frac1{x+2}\mathrm{d}\cos(x)\tag{3}\\
&=-\frac12\left[\frac{\cos(x)}{x+2}\right]_0^\pi-\frac12\int_0^\pi\frac{\cos(x)}
{(x+2)^2}\mathrm{d}x\tag{4}\\
&=\frac12\left(\frac1{\pi+2}+\frac12\right)-\frac12A\tag{5}
\end{align}
$$
Explanation:
$(1)$: use $\sin(2x)=2\sin(x)\cos(x)$
$(2)$: substitute $x\mapsto x/2$
$(3)$: prepare to integrate by parts
$(4)$: integrate by parts
$(5)$: plug in limits and use $A$
A: $$\int_0^{\pi/2} \frac{\sin(x)\cos(x)}{1+x}\,{\rm d}x$$
$$\int_0^{\pi/2} \frac{\sin(2x)}{2(1+x)}\,dx$$
With the substituition $u=2x$
$$\frac12\int_0^{\pi}\frac{\sin(u)}{u+2}\,du$$
Integrating by parts,
$$\frac12\left(\left[-\frac{\cos(u)}{u+2}\right]_0^\pi - A\right)$$
