Let's find the inflection points, we'll need to solve the equation for this
$$\frac{d^{2}}{d x^{2}} f{\left(x \right)} = 0$$
(the second derivative equals zero),
the roots of this equation will be the inflection points for the specified function graph:
$$\frac{d^{2}}{d x^{2}} f{\left(x \right)} = $$
the second derivative$$\frac{2 \left(1 + \frac{\cos^{2}{\left(x \right)}}{\sin^{2}{\left(x \right)}}\right) \cos{\left(x \right)}}{\sin{\left(x \right)}} = 0$$
Solve this equationThe roots of this equation
$$x_{1} = - \frac{\pi}{2}$$
$$x_{2} = \frac{\pi}{2}$$
You also need to calculate the limits of y '' for arguments seeking to indeterminate points of a function:
Points where there is an indetermination:
$$x_{1} = 0$$
$$x_{2} = 3.14159265358979$$
$$\lim_{x \to 0^-}\left(\frac{2 \left(1 + \frac{\cos^{2}{\left(x \right)}}{\sin^{2}{\left(x \right)}}\right) \cos{\left(x \right)}}{\sin{\left(x \right)}}\right) = -\infty$$
$$\lim_{x \to 0^+}\left(\frac{2 \left(1 + \frac{\cos^{2}{\left(x \right)}}{\sin^{2}{\left(x \right)}}\right) \cos{\left(x \right)}}{\sin{\left(x \right)}}\right) = \infty$$
- the limits are not equal, so
$$x_{1} = 0$$
- is an inflection point
$$\lim_{x \to 3.14159265358979^-}\left(\frac{2 \left(1 + \frac{\cos^{2}{\left(x \right)}}{\sin^{2}{\left(x \right)}}\right) \cos{\left(x \right)}}{\sin{\left(x \right)}}\right) = -1.08892367577758 \cdot 10^{48}$$
$$\lim_{x \to 3.14159265358979^+}\left(\frac{2 \left(1 + \frac{\cos^{2}{\left(x \right)}}{\sin^{2}{\left(x \right)}}\right) \cos{\left(x \right)}}{\sin{\left(x \right)}}\right) = -1.08892367577758 \cdot 10^{48}$$
- limits are equal, then skip the corresponding point
Сonvexity and concavity intervals:Let’s find the intervals where the function is convex or concave, for this look at the behaviour of the function at the inflection points:
Concave at the intervals
$$\left(-\infty, - \frac{\pi}{2}\right]$$
Convex at the intervals
$$\left[\frac{\pi}{2}, \infty\right)$$