My function is
$F(x)=Acos^{3}(x)+Bcos^2{x}+Ccos(x)+D$
and I need to find a function $y(x)=ax$ tangent to $F(x)$ and passing through the origin.
I tried analytically with $y=m(x-x_{0})+y_{0}$ but I got a huge mess and I don't know how to take it from there.
Is there any way to do it somehow easier?
Let us just consider the last two terms. The condition of tangency amounts to finding the extrema of
$$\frac{C\cos x+D}x.$$
The numerator of the derivative is
$$-C\sin(x)\,x-C\cos(x)-D.$$
This is a transcendental equation that cannot be solved analytically. There is no easy solution.