If $M = \int_{o}^{\pi/2}\frac{\cos x}{x+2}dx$ and $N = \int_{0}^{4}\frac{\sin x\cos x}{(x+1)^2}dx$ then the value of $M - N$ is I don't think we can directly solve both the definite integrals and get the answer because I checked these two with WolframAlpha and integration is too difficult.
What I tried is if I execute integration by parts on $M$ then:
$$\int\frac{\cos x}{x+2}dx = \frac{\sin x}{x+2} +  \int \frac{\sin x}{(x+2)^2}dx + c$$
and $$N = \frac{1}{2}\int_{0}^{4}\frac{\sin 2x}{(x+1)^2}dx$$
Now we can see that the 2nd element of 1st equation(right side) is somewhat analogous to $N$. But I don't know how to get past this point because the limits and other things are different.

If the question is Like this way...
$$\displaystyle M=\int_{0}^{\frac{\pi}{2}}\frac{\cos x}{x+2}dx$$ and $$\displaystyle N=\int_{0}^{\frac{\pi}{4}}\frac{\sin x\cdot \cos x}{(x+1)^2}dx\;,$$ Then find $M-N$
$\bf{Then\; Solution::}$ Given $$\displaystyle M=\int_{0}^{\frac{\pi}{2}}\frac{\cos x}{x+2}dx$$ and $$\displaystyle N=\int_{0}^{\frac{\pi}{4}}\frac{\sin x\cdot \cos x}{(x+1)^2}dx$$
Now We can write $$\displaystyle N= \frac{1}{2}\int_{0}^{\frac{\pi}{4}}\frac{\sin 2x}{(x+1)^2}dx = \frac{1}{2}\int_{0}^{\frac{\pi}{4}}\sin 2x \cdot \frac{1}{(x+1)^2}dx$$
Now Uding Integration by parts, We get
$$\displaystyle N= -\frac{1}{2}\left[\sin 2x \cdot \frac{1}{(x+1)}\right]_{0}^{\frac{\pi}{4}}+\frac{1}{2}\cdot 2\int_{0}^{\frac{\pi}{4}}\cos 2x\cdot \frac{1}{(x+1)}dx$$
Now Let $2x=t\;,$ Then $\displaystyle dx = \frac{1}{2}dt$ and Changing limits, We get
$$\displaystyle N=-\frac{1}{2}\cdot \frac{4}{\pi+4}+\int_{0}^{\frac{\pi}{2}}\frac{2\cos t}{t+2}\cdot \frac{1}{2}dt=-\frac{2}{\pi+4}+\int_{0}^{\frac{\pi}{2}}\frac{\cos x}{x+2}dx$$
Using $$\displaystyle \int_{a}^{b}f(t)dt = \int_{a}^{b}f(x)dx$$
So We get $$\displaystyle M=-\frac{2}{\pi+4}+N\Rightarrow M-N = -\frac{2}{\pi+4}.$$
