For all $x \in \left [ -\frac{\pi}{4},\frac{\pi}{4} \right ]$ proof that: $\left | f(x)-T_{2}(f,0)(x) \right | \leq \frac{2}{3}\left | x \right |^{3}$,
where $f(x) = \ln(\cos x)$
In the previous task (not homework), I have calculated the taylor-polynomial of $2^{nd}$ degree:
$$T_{2}(f,0)(x)=-\frac{1}{2}x^{2}$$
Everything inserted in the term, we get:
$$\left | \ln(\cos x) + \frac{1}{2}x^{2} \right | \leq \frac{2}{3}\left | x \right |^{3}$$
We now need two cases.
Case 1: The expressions between the modulus are all positive:
$$\ln(\cos x)+\frac{1}{2}x^{2}\leq \frac{2}{3}x^{3}$$
$$\ln(\cos x)\leq \frac{2}{3}x^{3}-\frac{1}{2}x^{2}$$
$$\ln(\cos x)\leq x^{2}\cdot(\frac{2}{3}x-\frac{1}{2})$$
$$\cos x\leq e^{x^{2}\cdot(\frac{2}{3}x-\frac{1}{2})}$$
Example input $x=-\frac{\pi}{4}$ $\Rightarrow$
$$0 \leq e^{-\frac{\pi}{4}^{2}\cdot(\frac{2}{3} \cdot -(\frac{\pi}{4})-\frac{1}{2})}$$
Case 2 (negative) is done analogically and its final form is:
$$\ln(\cos x)\geq x^{2}\cdot(\frac{2}{3}x-\frac{1}{2})$$
Doesn't make much sense, actually in the end I get a contradiction / mistake if we compare case 1 with case 2 : /
This looks like a problem about calculating an error bound for a Taylor series.
In general, the error $E_n(x)$ for the $n$th-degree Taylor polynomial $T_n(x)$ of $f(x)$ centered at $x=a$ is $$ |E_n(x)| \le \frac{M}{(n+1)!} |x-a|^{n+1},$$ where $M \ge |f^{(n+1)}(t)|$ on the interval between $0$ and $x$ (note that $x$ can be positive or negative). Actually, since we are told that we want a bound for all $x \in [-\pi/4, \pi/4]$, then we can just take $$M = \max_{-\frac{\pi}{4} \le t \le \frac{\pi}{4}} |f^{(n+1)}(t)|.$$
In our case we have $n = 2$, $a = 0$, and $f(x) = \ln(\cos x)$. Then $f'(x) = \frac{1}{\cos x} \cdot (-\sin x) = -\tan x$, and so $f''(x) = -\sec^2 x$. Then we have $$ T_2(x) = \frac{1}{2!} \cdot f''(0) \cdot (x-0)^2 = -\frac{1}{2}x^2, $$ as you've already found.
To find $M$ we'll need $|f'''(x)|$. $$ |f'''(x)| = |-2\sec x \cdot \sec x \tan x| = 2\sec^2 x |\tan x|$$
So we need to maximize $2\sec^2 t |\tan t|$ on the interval $[-\pi/4, \pi/4]$. First of all, note that $2\sec^2 t |\tan t|$ is an even function. Therefore we only need to consider it on $[0,\pi/4]$. Second, because $\tan t > 0$ for $0 < t < \pi/2$, we can drop the absolute value sign on $|\tan t|$. So we want $M$ such that $$M = \max_{0 \le t \le \pi/4} 2\sec^2 t \tan t.$$
If we plot $2\sec^2 t \tan t$ we see that it's strictly increasing. Therefore the max happens at $t = \pi/4$. And we have $$M = 2 \sec^2(\pi/4) \tan(\pi/4) = 2 \cdot 2 \cdot 1 = 2.$$
Put this all together in the formula for $|E_n(x)|$ given above to get the desired result.