I have this problem
If $f(x)=x^3+x^2+ax+4\sin x$ is increasing for all real values of $x$, then $a$ lies in the interval
So what I did was to first differentiate the function and equate it to greater than equal to zero ie
$f'(x)=3x^2+2x+a+4\cos x \geq 0$
I also know that the determinant of this value should be less than 0.
But I don't know what to do after this. I asked my teacher and some other sources and they just substituted $\cos x=-1$ and wrote the equation as :
$f'(x)=3x^2+2x+a-4 \geq 0$
I don't know what to do after this and why did my teacher do so. If you can guide me then it would be great.
To show why the idea of "just replace $\cos(x)$ with it's smallest value $-1$" doesn't give you the whole range of $a$, look at the following picture, that plots both the actual derivative $f'(x)=3x^2+2x+a+4\cos(x)$ in red and the "replacement" $r(x)=3x^2+2x+a-4$ in black, for $a=0$:
$r(x)$ is negative for some $x$ around $0$, and that's why Devansh Kamra's solution says $a$ should be at least $\frac{13}3$. But as can be seen, the actual derivative (in red) is not negative anywhere. So $a=0$ is a valid choice for $a$, that Devansh Kamra's solution ignores.
The reason this is so is that "just replace $\cos(x)$ with it's smallest value $-1$" is conservative: You can see in the picture that the red plot is always above the black plot, which is easy to understand because the difference between those 2 functions is $4\cos(x)+4$, which is $\ge 0$. Devansh Kamra's solution correctly finds exactly all $a$ where the replacement function $r(x)$ is non-negative. This in turn makes sure that the actual derivative $f'(x)$ is also non-negative, so we are now sure that for all $a \ge \frac{13}3$ $f'(x)$ is non-negative.
But we can't make the reverse conclusion, we don't know if more $a$ exist. Because we assumed "the worst case" for $\cos(x)$ (that it is $-1$), we are missing $a=0$, where around $x=0$ $\cos(x)$ is near $1$, so the $+4\cos(x)$-term is "actively helping" to keep $f'(x)$ above $0$.
So how to find the actual range of $a$ such that $f'(x) \ge 0$?
We have $f'(x)=3x^2+2x+a+4\cos(x)$, so $a$ is just an added constant.
If we find the minumum value of $g(x)=3x^2+2x+4\cos(x)$, we have found the maximal possible $-a$.
So we have $g'(x)=6x+2-4\sin(x), g''(x)=6-4\cos(x)>0$. $g(x)$ is dominated by the quadratic term $3x^2$ for large $|x|$ and $g''$ is always positive, so solving $g'(x)=0$ will find the $x$-value where $g(x)$ becomes minimal.
As can be seen here, there is exactly one solution:
I don't think there is a way to find the solution explicitely, a common fix-point iteration would be
$$x_0=-0.8, x_{n+1}=\frac{2\sin(x_n)-1}3$$
and this leads to the solution $x_s \approx -0.82140...$ and $g(x_s)\approx 3.106...$
This means that the interval for $a$ where $f'(x)$ is always non-negative is
$$a \ge -g(x_s) \approx -3.106...,$$
where $x_s$ is the only real solution to $6x+2=4\sin(x)$, $x_s \approx -0.82140...$.