# Finding a root of a function via Rolle's theorem

Consider the function $f(t)=a(1-t)\cos(at)-\sin (at)$, where $a\in\mathbb R$.

To show that it has a root in the unit interval I am urged to integrate $f$ and apply Rolle's Theorem.

Attempt:

$$\int a(1-t)\cos(at)-\sin (at)dt=a\int\cos(at)dt-a\int t\cos(at)dt-\int\sin (at)dt$$

$$=\sin (at)-at\sin(at)+a\int\cos(at)dt+\frac1a\cos(at)=\sin (at)-at\sin(at)+\sin(at)+\frac1a\cos(at)$$

$$=(2-at)\sin(at)+\frac1a\cos(at)$$

Therefore, $F(x)=\int_0^xf(t)dt=(2-ax)\sin(ax)+\frac1a\cos(ax)-\frac1a\cos(a)$.

Evaluating at $0$ and $1$, we get $F(0)=(1-\cos(a))\frac1a$ and $F(1)=(2-a)\sin(a)$.

So $F(1)\not=F(0)$ and we cannot apply Rolle's Theorem.

What did I do wrong? Does $f$ have no real root?

Edit: $$\int a(1-t)\cos(at)-\sin (at)dt=a\int\cos(at)dt-a\int t\cos(at)dt-\int\sin (at)dt=$$

$$\sin (at)-t\sin(at)+\int\sin(at)dt-\int\sin (at)dt$$

-

Your integration is wrong it should be: $$F(t)=(1-t)\sin at+\lambda\\ F(0)=(1-0)\sin0+\lambda=\lambda\\ F(1)=(1-1)\sin a +\lambda=\lambda\\ \text{Thus, }F(0)=F(1)$$
If there is a root, there is some $t$ such that $$f(t)=a(1-t)\cos(at)-\sin (at)=0$$ Changing variable $y=at$ gives $$f(y)=(a-y)\cos(y)-\sin(y)=0$$ Assuming $\cos(y) \neq 0$, then $$\cos(y) \Big((a-y)-\tan(y)\Big)=0$$ The last term is the intersection of the straight line $z=a-y$ and the curve $z=\tan(y)$ which always exists.