0

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).

  • 4
    Welcome to MSE. Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or closed. To prevent that, please [edit] the question. This will help you recognize and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers. – José Carlos Santos Mar 25 '22 at 11:41

1 Answers1

1

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.

Angel
  • 3,774
  • 12
  • 14
  • This is a nicely detailed and very informative answer. My only doubt about upvoting it is that it may encourage users to answer questions that are not of the required quality, such as the above one. Also, if the questions get downvoted more than it has been until now, and the poster does not improve it, it may be removed, and all your efforts may have been in vain (and the reputation you got from your answer will disappear). Please avoid answering low quality questions, and try to encourage the posters to improve their posts first. – Mohsen Shahriari Mar 25 '22 at 21:38
  • Thank you so much Angel for the brilliantly crafted answer! – Karl Hedberg Mar 25 '22 at 22:05
  • 2
    @MohsenShahriari Thank you, I appreciate the feedback. I agree with everything you just said. I would just like to clarify that, at least in my personal view, the question is not of such low quality that it needs to be closed or downvoted. That is why I decided to answer. But it could be that my perspective is a bit skewed on the matter. I will take your criticism into consideration for next time. – Angel Mar 28 '22 at 12:15