I want the minimum value of A. (closed form)
$$A = \int_{0}^{p} \sin(x) dx + \int_{p}^{\frac{\pi}{2}} (\sin(x)-\sin(p))dx$$ $$0 \leq p \leq \frac{\pi}{2}$$
So... $$A = p \cdot \sin(p) - \frac{\pi}{2}\sin(p) + 1$$
$$\frac{d}{dp} A = \sin(p) + p \cdot \cos(p) - \frac{\pi}{2}\cos(p) = 0$$
$$\tan(p) + p - \frac{\pi}{2} = 0$$
I stopped here. I know that:
$$A = 1 - \tan(p) \cdot \sin(p)$$
$$\sin(p) = \cos(\tan(p))$$ $$\cos(p) = \sin(\tan(p))$$ $$\tan(p) = \cot(\tan(p))$$ $$\csc(p) = \sec(\tan(p))$$ $$\sec(p) = \csc(\tan(p))$$ $$\cot(p) = \tan(\tan(p))$$
$$p \approx 0.71046$$ $$A \approx 0.4389$$
EDIT:
$$\tan(p) + p - \frac{\pi}{2} = 0$$
$$\tan(p) = \frac{\pi}{2} - p$$
$$-cot\left(p-\frac{\pi}{2}\right) = \frac{\pi}{2} - p$$
$$cot\left(p-\frac{\pi}{2}\right) = p - \frac{\pi}{2}$$
$$B:=p-\frac{\pi}{2}$$
$$cot(B) = B$$
"This kind of equations which mix polynomial and trigonometric terms do not, in general, show solutions which have a closed form expression..." as said by Claude Leibovici here.