How would you be solve sin x = 1 - x, without drawing the graph and manually measuring the point of intersection?
6 Answers
There's no closed-form analytical solution for this kind of transcendental equation. You can either solve it graphically (as you said) or numerically. There are various methods for solving it numerically, see this Wikipedia article for an overview.
If you're not looking for a particularly efficient solution, the simplest thing to do in this case might be to write the equation as
$$x=1-\sin x$$
and iterate the map
$$x_{n+1}=1-\sin x_n$$
until you achieve satisfactory convergence. This is very inefficient, though; it only makes sense if you do it on a computer and don't mind if it takes a lot of operations; you'll need a lot of patience to get anywhere with it with a calculator. :-)
A far more efficient method that yields $x$ to double-precision machine accuracy within a couple of iterations would be Newton's method:
$$f(x) = x + \sin x - 1 \stackrel{!}{=} 0\;,$$
$$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=x_n - \frac{x+\sin x - 1}{1 + \cos x}\;.$$
-
1Is there any problem with the following approach? $\sin (\pi/2-x)=1-(\pi/2-x) \rightarrow \cos(x)=1-(\pi/2-x)$. Then use the identity $sin^2 x+cos^2 x=1$ to find x – user11869 Jun 17 '11 at 15:36
-
If the figure of merit is operator time instead of computer time, a spreadsheet can make the programming very easy. Just put a starting value (0.5 is a good one, as others have said) in A1, =1-sin(x) in B1, =B1 in A2, and copy down until you see convergence. – Ross Millikan Jun 17 '11 at 15:36
-
@user11869: I don't understand -- how would you then use that identity to find $x$? – joriki Jun 17 '11 at 19:25
-
$(1-x)^2+[1-(\pi/2-x)]^2=1$ and solve this equation – user11869 Jun 17 '11 at 20:00
-
@user11869: I see. You're assuming that the given equation holds both for $x$ and for $\pi/2-x$. But there's no reason why it should hold for $\pi/2-x$. – joriki Jun 17 '11 at 20:41
-
@joriki: how can one see that there is no closed form solution? (looking at the date of the answer, I'm very late though...;)) – Nils Matthes Sep 15 '12 at 15:32
-
@Nils: I'm not aware of any formal method of proving that. There may be one, but I was merely expressing knowledge from experience: I'd be very surprised if there were a closed-form solution because I've never seen any for equations like this, and I'm pretty sure I would have come across them if they were known. – joriki Sep 16 '12 at 14:28
-
@joriki: ah, too bad. I've never seen a formal argument in favor of the kind of statement "xy cannot be expressed by using certain standard-functions", so I was hoping for one. Anyway, thanks for your explanation. – Nils Matthes Sep 16 '12 at 14:41
-
@Nils: You may be interested in this: http://en.wikipedia.org/wiki/Risch_algorithm – joriki Sep 16 '12 at 14:55
-
@joriki: interesting, thanks! – Nils Matthes Sep 16 '12 at 18:50
-
@Nils: Also this: http://math.stackexchange.com/questions/155/how-can-you-prove-that-a-function-has-no-closed-form-integral – joriki Sep 19 '12 at 16:58
Below is a calculus-type approach. Remark that to first order $\sin x \simeq x,$ so your result will be somewhere around $x = \frac{1}{2}.$ That suggests a Taylor expansion of sine around $\frac{\pi}{6} \simeq \frac{1}{2}.$ You can introduce $\epsilon = x - \frac{\pi}{6},$ such that $$\sin(x) = \frac{1}{2} + \frac{\sqrt{3}}{2}\epsilon - \frac{1}{4}\epsilon^2 + \mathcal{O}(\epsilon^3).$$ Identifying $1 - x = 1 - (\frac{\pi}{6} + \epsilon),$ you can equate both sides of your equation and solve a linear, quadratic, ..., polynomial equation in $\epsilon$, which will however involve knowing a reasonable approximation to $\pi$ and/or $\frac{\pi}{6}.$

- 796
For such cases, I would use Wims Function Calculator. Type the function $f(x)=\sin(x)-(1-x)$, and check the last box to find the root of the equation $\sin(x)-(1-x) = 0$. You can obtain the value of the root even up to $200$ digits. In your example, the root is approximately $0.51097342938856910952001397114508063204535889262375023988987953800752819385525987164073419474333797073844705378201625612601584766524335342369803019732463083576632594596747582089441042803074463769962092$.

- 24,077
As joriki mentions, simple-minded fixed-point iteration works if you're not too concerned about efficiency in obtaining the numerical solution (One usually has to be very lucky to obtain a closed form solution for a transcendental equation; this is not one of those lucky situations.). I'll only note that making use of the fact that $\sin\;x\approx x$, you can then say that there is a solution very near $x=.5$. Feed that to a fixed-point iteration, Newton, or Halley, and you can then obtain a good numerical approximation (which Shai has already given for you).
It depends on what you mean by "solving". If you want to show that a solution exists, use the intermediate value theorem. Expressing the solution by "elementary functions" (also called an analytical solution or closed-form solution, but note that these terms don't have universal definitions) is not possible. If you want a numerical solution, then use Newton's method.

- 5,243
-
1Using Newton-Raphson method
$f(x) := sin(x) + x - 1$, $ f'(x) = cos(x) + 1$,
$x = x - \frac{f(x)}{f'(x)}$
$x = x - \frac{sin(x) + x - 1}{cos(x) + 1}$,
Use an initial estimate between $0$ and $\frac{\pi}{2}$ i.e. $\frac{\pi}{4}$ and iterate?
– 911 Mar 11 '11 at 09:48
As @Gerben answered, building the Taylor series around $x=\frac \pi 6$ gives $$y=x+\sin(x)-1=\frac{\pi -3}{6} +\frac{2+\sqrt{3}}{2} x+\sum_{n=2}^\infty \frac{\sqrt{3} \sin \left(\frac{\pi n}{2}\right)+\cos \left(\frac{\pi n}{2}\right)}{2 n!} \left(x-\frac{\pi }{6}\right)^n$$ Truncated to $O\left(\left(x-\frac{\pi }{6}\right)^6\right)$ for example and using series reversion, then $$x=\frac{\pi }{6}+t+\left(1-\frac{\sqrt{3}}{2}\right) t^2+\left(3-\frac{5}{\sqrt{3}}\right) t^3+\left(\frac{67}{6}-\frac{77}{4 \sqrt{3}}\right) t^4+\left(\frac{232}{5}-\frac{803}{10 \sqrt{3}}\right) t^5+O\left(t^{6}\right)$$ where $t=\frac{y+\frac{3-\pi }{6}}{1+\frac{\sqrt{3}}{2}}$.
Making $y=0$ that is to say $t=-\frac{\left(2-\sqrt{3}\right) (\pi -3)}{3} $, this gives $x=0.51097342938847$ while the exact solution is $x=0.51097342938857$.

- 260,315