I realised the other day that by applying absolute value signs to the cosine function and then integrating, I would get an almost sine function that doesn't have negative slope.
And then I also noticed that it would probably stay close to the line $$g(x)=\frac {2x}{\pi}$$
So could someone integrate $$f(x)=\int|\cos(x)|dx,$$ then set it equal to $g(x)$ and solve?
Your integral (from $0$) may be represented in form
$$\lim_{N\to\infty}\left( \sin(x)\operatorname{sgn}(\cos(x))+ \sum _{n=1}^N\left(2\operatorname{H}\left(x-\frac{\pi }{2}+n\pi\right)-2\right)+ \sum _{n=0}^{N-1}2\operatorname{H}\left(x-\frac{\pi }{2}-n\pi\right)\right)$$
Where $\operatorname{H}$ is the Heaviside step function. You can see the plot here. It is close to the line $y=2x/\pi$ and the functions are equal at points $$\left(\frac{k\pi }{2},k\right),\quad k\in\mathbb{Z}$$