Find mean and variance using characteristic function Consider a random variable with characteristic function
$$
\phi(t)=\frac{3\sin(t)}{t^3}-\frac{3\cos(t)}{t^2}, \ \text{when} \ t \neq0
$$
How can I compute the $E(X)$ and $Var(X)$ by using this characteristic function? I'm stuck because if I differentiate I got $\phi'(t)=\frac{3t^2\sin(t)+9t\cos(t)-9\sin(t)}{t^4}$ which is undefined at $t=0$.
Do I need to use Taylor expansion to approximate sin and cos ?

In general, if the power-series expansion holds for a characteristic function of random variable $X$, which is the case of this $\varphi(t)$ (because power-series expansions for $\sin t$ and $\cos t$ hold and the negative exponent terms cancelled each other, as will be shown in the derivation below), the moments of $X$ can be read off from it (for a rigorous proof, see Probability and Measure by Patrick Billingsley, pp. 342 -- 345):
\begin{align}
\varphi^{(k)}(0) = i^kE[X^k]. \tag{1}
\end{align}
$(1)$ is analogous to the relationship $E[X^k] = m^{(k)}(0)$ between moments and the moment generating function, which is perhaps more familiar to statisticians.
Therefore, to determine $E[X]$ and $\operatorname{Var}(X)$, it is sufficient to evaluate $\varphi'(0)$ and $\varphi''(0)$, to which you can apply L'Hopital's rule for multiple times (which is more verbose). First, because $\sin t - t\cos t \to 0$ as $t \to 0$,
\begin{align}
\lim_{t \to 0}\varphi(t) = 3\lim_{t \to 0}\frac{\sin t - t\cos t}{t^3} 
= 3\lim_{t \to 0}\frac{\cos t - (\cos t - t\sin t)}{3t^2} 
= \lim_{t \to 0} \frac{\sin t}{t} = 1,
\end{align}
which lends us the legitimacy of using L'Hopital rule for evaluating
\begin{align}
\varphi'(0) &= \lim_{t \to 0}\frac{\varphi(t) - \varphi(0)}{t} \\
&= \lim_{t \to 0} \varphi'(t) \\
&= 3\lim_{t \to 0}\frac{t^4\sin t - 3t^2(\sin t - t\cos t)}{t^6} \\
&= 3\lim_{t \to 0}\frac{t^2\sin t - 3\sin t + 3t\cos t}{t^4} \\
&= 3\lim_{t \to 0}\frac{2t\sin t + t^2\cos t - 3\cos t + 3\cos t - 3t\sin t}{4t^3} \\
&= \frac{3}{4}\lim_{t \to 0}\frac{t\cos t - \sin t}{t^2} \\
&= \frac{3}{4}\lim_{t \to 0}\frac{\cos t - t\sin t - \cos t}{2t} = 0. 
\end{align}
I will leave the task of getting $\varphi''(0)$ in this way back to you.
Alternatively, a direct power-series expansion method (which I highly recommend as the first option for general limit evaluation tasks) has been mentioned in whuber's answer and my previous comments.  In detail, it follows by (see, for example, Eq. (23) and Eq. (6) in this link)
\begin{align}
& \sin t = t - \frac{1}{3!}t^3 + \frac{1}{5!}t^5 + O(t^7), \\
& \cos t = 1 - \frac{1}{2}t^2 + \frac{1}{4!}t^4 + O(t^6)
\end{align}
that
\begin{align}
 & \varphi(t) = 3t^{-3}\sin t - 3t^{-2}\cos t \\
=& 3t^{-3}\left(t - \frac{1}{3!}t^3 + \frac{1}{5!}t^5 + O(t^7)\right) 
- 3t^{-2}\left(1 - \frac{1}{2}t^2 + \frac{1}{4!}t^4 + O(t^6)\right) \\
=& 1 + \frac{1}{40}t^2 - \frac{1}{8}t^2 + O(t^4) \\
=& 1 - \frac{1}{10}t^2 + O(t^4). 
\end{align}
From which it is immediate to conclude
\begin{align}
\varphi(0) = 1, \; \varphi'(0) = 0, \; \varphi''(0) = -\frac{1}{5}. 
\end{align}
It then follows by $(1)$ that
\begin{align}
E[X] = -i\varphi'(0) = 0, \; E[X^2] = -\varphi''(0) = \frac{1}{5}.
\end{align}
Therefore, $E[X] = 0, \operatorname{Var}(X) = \frac{1}{5}$.
