# Finding an infinitely differentiable function $f$ on $R$ with the same Taylor Series

I am trying to find an infinitely differentiable function $f$ on $R$ with the same Taylor Series as $\sin x$ but $f(x)\ne \sin x$ for $x \ne 0$

I am having trouble with this question because to my knowledge there is no Taylor series that could fit this criteria

I know that the Taylor series for $\sin x$ is,

$$\sum_{n=0}^{\infty}(-1)^n\frac{x^{2n+1}}{(2n+1)!}$$

But is it possible to find an infinitely differentiable function $f$ on $R$ with the same Taylor Series as $\sin x$ but $f(x)\ne \sin x$ for $x \ne 0$? And if not, why?

• Formatting tip: notice that if you enter $\sin x$ which gives $\sin x$, the function looks much better than if you enter $sin x$ which gives $sin x$. The same goes for logarithmic functions as well see $\ln x$ = $\ln x$ or $\log x$ = $\log x$ as opposed to $ln x$ = $ln x$ and $log x$ = $log x$
– user409521
Mar 20, 2017 at 0:47

You can completely ignore the Taylor series of $\sin(x)$. What you want to find is a function $g(x)$ such that $0=g(0)=g'(0)=g''(0)=\dots$, but $g(x)\neq 0$ for $x\neq 0$. Then $f(x)=\sin(x)+g(x)$ will equal, and have the same derivatives as, $\sin(x)$ for $x=0$, but will differ from $\sin(x)$ elsewhere. One such function is:
$$g(x)=\begin{cases}e^{-1/x^2}&x\neq0\\0&x= 0\end{cases}.$$
• how would you calculate $g'(0)$ then? Mar 20, 2017 at 0:43
• @Lubin.Let $g^n$ be the $n$th derivative of $g$, with $g^0=g.$ Then $g^n(x)=P_n(1/x)e^{-1/x^2}$ for $x\ne 0,$ where $P_n$ is a polynomial. Suppose $g^n(0)=0$.For $x\ne 0$ let $x=1/y.$ Then $(g^n(x)-g^n(0))/(x-0)=$ $yg^n(1/y)$ $=yP_n(y)/e^{y^2}.$ And $y\to \infty$ as $x\to 0,$ while $e^{y^2}$ grows faster than any polynomial as $y\to \infty$ because $e^{y^2}>y^{2n}/n!$ when $y\ne 0.$ Hence $g^n(0)=0\implies g^{n+1}(0)=0.$ Mar 20, 2017 at 11:12
• @Lubin. My previous comment should say : $e^{y^2}$ grows faster than $yP_n(y)$ as $y\to \infty$ because $e^{y^2}>y^{2+2\deg (P_n)}/(1+\deg (P_n))!$ when $y\ne 0$. I ran out of editing time, which for me is mostly typo-correction time. Mar 20, 2017 at 11:26