Method of obtaining solution to functional equation: $f(x+1)-f(x)=\sin(x)$

95 Views Asked by At

Wolfram Alpha's solution to the problem $f(x+1)-f(x)=\sin(x)$ is: $f(x) = c_1 - \frac{\sin(x)}2 + \cot(\frac12) \sin^2(\frac{x}{2})$, but they don't provide a step-by-step solution. How could you prove this result?

Context: I was trying to find the sum for the function sin(x). The left side of the equation is the discrete derivative while the right side is the result, and I'm trying to find which function, when derived, will get me sin(x).

1

There are 1 best solutions below

3
On BEST ANSWER

The equation $f(x+1)-f(x)=\sin(x)$ determines $f$ up to the interval $[0,1)$ Thus, any function $[0,1)\to\mathbb{R}$ can be extended to be a solution of the functional equation above over $\mathbb{R}.$ Let $\alpha\in[0,1),$ hence $f(\alpha+1)-f(\alpha)=\sin(\alpha).$ The equation holding for all $x$ in $\mathbb{R}$ thus implies that $f(\alpha+2)-f(\alpha+1)= \sin(\alpha+1),$ and in general, $f(\alpha+n+1)-f(\alpha+n)=\sin(\alpha+n).$ Thus, $$\sum_{n=0}^{m-1}f(\alpha+n+1)-f(\alpha+n)=\sum_{n=0}^{m-1}\sin(\alpha+n)=f(\alpha+m)-f(\alpha).$$ Hence, for all $\alpha\in[0,1),$ $$f(\alpha+m)=f(\alpha)+\sum_{n=0}^{m-1}\sin(\alpha+n).$$ Notice that $\sin(\alpha+n)=\sin(\alpha)\cos(n)+\cos(\alpha)\sin(n),$ so $$f(\alpha+m)=f(\alpha)+\sum_{n=0}^{m-1}[\sin(\alpha)\cos(n)+\cos(\alpha)\sin(n)]$$ $$=f(\alpha)+\sin(\alpha)\sum_{n=0}^{m-1}\cos(n)+\cos(\alpha)\sum_{n=0}^{m-1}\sin(n).$$ Remember that $$\cos(n)=\frac{e^{in}+e^{-in}}2,$$ so $$\sum_{n=0}^{m-1}\cos(n)=\frac12\left[\sum_{n=0}^{m-1}(e^i)^n+\sum_{n=0}^{m-1}(e^{-i})^n\right]=\frac12\left[\frac{1-e^{im}}{1-e^i}+\frac{1-e^{-im}}{1-e^{-i}}\right]=\frac12\left[\frac{1-e^{im}}{1-e^i}\frac{1-e^{-i}}{1-e^{-i}}+\frac{1-e^{-im}}{1-e^{-i}}\frac{1-e^i}{1-e^i}\right]=\frac14\left[\frac{(1-e^{im})(1-e^{-i})+(1-e^{-im})(1-e^i)}{1-\cos(1)}\right]=\frac14\left[\frac{1-e^{-i}-e^{im}+e^{i(m-1)}+1-e^i-e^{-im}+e^{-i(m-1)}}{1-\cos(1)}\right]=\frac12\left[\frac{1-\cos(1)-\cos(m)+\cos(m-1)}{1-\cos(1)}\right]=\frac12\left[1+\frac{\cos(m-1)-\cos(m)}{1-\cos(1)}\right].$$ Also, $$\sin(n)=\frac{e^{in}-e^{-in}}{2i},$$ so $$\sum_{n=0}^{m-1}\sin(n)=\frac1{2i}\left[\sum_{n=0}^{m-1}(e^i)^m-\sum_{n=0}^{m-1}(e^{-i})^m\right]=\frac1{4i}\left[\frac{(1-e^{im})(1-e^{-i})-(1-e^{-im})(1-e^i)}{1-\cos(1)}\right]=\frac1{4i}\left[\frac{1-e^{-i}-e^{im}+e^{i(m-1)}-1+e^i+e^{-im}-e^{-i(m-1)}}{1-\cos(1)}\right]=\frac12\left[\frac{\sin(m-1)-\sin(m)+\sin(1)}{1-\cos(1)}\right].$$ Therefore, $$f(\alpha+m)=f(\alpha)+\frac{\sin(\alpha)}2+\frac{\sin(\alpha)[\cos(m-1)-\cos(m)]}{2[1-\cos(1)]}+\frac{\sin(1)\cos(\alpha)}{2[1-\cos(1)]}+\frac{\cos(\alpha)[\sin(m-1)-\sin(m)]}{2[1-\cos(1)]}.$$ This can be simplified further. Notice that $$\cos(m-1)-\cos(m)=\cos(1)\cos(m)+\sin(1)\sin(m)-\cos(m)$$ $$=[\cos(1)-1]\cos(m)+\sin(1)\sin(m),$$ hence $$\frac{\sin(\alpha)[\cos(m-1)-\cos(m)]}{2[1-\cos(1)]}=-\frac{\sin(\alpha)\cos(m)}2+\frac{\sin(1)\sin(\alpha)\sin(m)}{2[1-\cos(1)]}$$ while $$\sin(m-1)-\sin(m)=-\sin(1)\cos(m)+\cos(1)\sin(m)-\sin(m)=-\sin(1)\cos(m)+[\cos(1)-1]\sin(m)$$ hence $$\frac{\cos(\alpha)[\sin(m-1)-\sin(m)]}{2[1-\cos(1)]}=-\frac{\sin(1)\cos(\alpha)\cos(m)}{2[1-\cos(1)]}-\frac{\cos(\alpha)\sin(m)}2.$$ Therefore, $$f(\alpha+m)=f(\alpha)+\frac{\sin(\alpha)}2-\frac{\sin(\alpha)\cos(m)}2+\frac{\sin(1)\sin(\alpha)\sin(m)}{2[1-\cos(1)]}-\frac{\sin(1)\cos(\alpha)\cos(m)}{2[1-\cos(1)]}-\frac{\cos(\alpha)\sin(m)}2=f(\alpha)+\frac{\sin(\alpha)}2-\frac{[\sin(\alpha)\cos(m)+\cos(\alpha)\sin(m)]}2-\frac{\sin(1)}{2[1-\cos(1)]}[\cos(\alpha)\cos(m)-\sin(\alpha)\sin(m)]=f(\alpha)+\frac{\sin(\alpha)}2-\frac{\sin(\alpha+m)}2-\frac{\sin(1)\cos(\alpha+m)}{2[1-\cos(1)]}.$$ This works for all $m\in\mathbb{N},$ but exploiting symmetries and antisymmetries with respect to parity, this works for all $m\in\mathbb{Z}.$ Choose some $f$ defined on $[0,1).$ Then $f$ can be extended to $\mathbb{R}$ via the above solution, and it will satisfy the functional equation everywhere. Also, notice that for all $m\in\mathbb{Z}$ and every $\alpha\in[0,1),$ there exists some $x\in\mathbb{R}$ such that $m=\lfloor{x}\rfloor$ and $\alpha=x\;\mathrm{mod}\;1=x-\lfloor{x}\rfloor.$ Therefore, $x=\alpha+m,$ and so $$f(x)=f(x\;\mathrm{mod}\;1)+\frac{\sin(x\;\mathrm{mod}\;1)}2-\frac{\sin(x)}2-\frac{\sin(1)}{2[1-\cos(1)]}\cos(x).$$ This solution determines $f$ uniquely up to its determination on $[0,1)$ as a solution to the functional equation. All that is required for further unique determination is $f(x\;\mathrm{mod}\;1).$

To finish this off, notice that $$\frac{\sin(1)}{1-\cos(1)}=\cot\left(\frac12\right),$$ and so $$-\frac{\sin(1)}{2[1-\cos(1)]}\cos(x)=-\frac{\cot\left(\frac12\right)\cos(x)}2=\frac{\cot\left(\frac12\right)}2-\frac{\cot\left(\frac12\right)\cos(x)}2-\frac{\cot\left( \frac12\right)}2$$ $$=\cot\left(\frac12\right)\left[\frac{1-\cos(x)}2\right]-\frac{\cot\left(\frac12\right)}2=-\frac{\cot\left(\frac12\right)}2+\cot\left(\frac12\right)\sin\left(\frac{x}2\right)^2.$$ Therefore, $$f(x)=f(x\;\mathrm{mod}\;1)+\frac{\sin(x\;\mathrm{mod}\;1)}2-\frac{\cot\left(\frac12\right)}2-\frac{\sin(x)}2+\cot\left(\frac12\right)\sin\left(\frac{x}2\right)^2.$$ Finally, let $$C_1(x\;\mathrm{mod}\;1)=f(x\;\mathrm{mod}\;1)+\frac{\sin(x\;\mathrm{mod}\;1)}2-\frac{\cot\left(\frac12\right)}2,$$ and thus $$f(x)=C_1(x\;\mathrm{mod}\;1)-\frac{\sin(x)}2+\cot\left(\frac12\right)\sin\left(\frac{x}2\right)^2.$$ This is precisely the solution in your post, although in your post, it is notated sloppily, since it is not specified that $C_1$ is an arbitrary function $[0,1)\to\mathbb{R},$ and it instead suggests that $C_1$ is some arbitrary real number. Anyway, $f$ solves the equation, and this is the complete family of solutions.