1

Give exact ways of avoiding loss-of-significance errors in the following computations:

a. $log(x+1)-log$, with large $x$

b. $\frac{1-cosx}{x^2}$, with $x\approx 0$

c.$(1+x)^{1/3}-1$, with $x\approx 0$

Am I doing this correctly?

a. I got $$log(x+1)-log(x)= log(\frac{x+1}{x})= log(1+\frac{1}{x}) \approx \frac{1}{x}-\frac{1}{2x^2}+\frac{1}{3x^3} ...$$

c. I got $$\frac{x}{(1+x)^{2/3}+(1+x)^{1/3}+1}$$

b. I am stuck

Lays
  • 2,023
  • The question does not ask for the limits. – André Nicolas Feb 04 '13 at 09:04
  • You aren't being asked to find limits, but to carry out computations. Sure, $\log1000000-\log999999$ is near zero, but how do you get a good handle on it? – Gerry Myerson Feb 04 '13 at 09:05
  • 4
    If for example you have a calculator that computes correctly to $8$ significant figures, but no more, and you calculate $\sqrt[3]{1+x}$, where $x=10^{-7}$, the answer is very close to $1$, so when you subtract $1$ you don't get $8$ figure accuracy. How can you rearrange the calculation to get close to $8$ figure accuracy? – André Nicolas Feb 04 '13 at 09:14
  • @AndréNicolas I knew what I was doing was wrong. I should have not listened to my roommate. Is my revised answer correct? – Lays Feb 04 '13 at 09:23
  • @GerryMyerson I was mistaken. I have revised my answer. Do you mind if you can check my answer and help me start on b please? – Lays Feb 04 '13 at 09:45
  • 1
    Those look like good ways to rearrange the terms for more accurate computations. In c) you've left out some parentheses. In b) you could try to make use of $\sin^2x+\cos^2x=1$. – Gerry Myerson Feb 04 '13 at 09:56
  • @GerryMyerson Thank you very much! – Lays Feb 04 '13 at 10:03
  • @Lays: your answer for c) is absolutely correct, but if you are concerned with expense of computations in taking cube roots, the Taylor/binomial expansion is better. – Ron Gordon Feb 04 '13 at 10:33
  • 1
    There is a connection with computing limits. For both limits and estimation, we need to get very good control over the behaviour of our function near $x=a$. – André Nicolas Feb 04 '13 at 10:41

2 Answers2

1

As for part (c), You can use the Taylor series to get: $$(1+x)^{1/3}\sim 1+\frac{x}{3}-\frac{x^2}{9}+O(x^3)$$

1

a)

$$\log{(x+1)} = \log{x} + \log{\left (1 + \frac{1}{x} \right )}$$

Use the Taylor series approximation for $\log{y}$ for small values of $y$:

$$\log{(x+1)} - \log{x} = \frac{1}{x} - \frac{1}{2 x^2} + \frac{1}{3 x^3} + \dots$$

b) Again, use the Taylor series for $\cos{x}$ about $x=0$:

$$\frac{1-\cos{x}}{x^2} = \frac{1}{2} - \frac{x^2}{24} + \dots$$

c) Taylor expansion or a binomial expansion:

$$\begin{align}(1+x)^{1/3}&= 1 + \frac{1}{1!} \frac{1}{3} x + \frac{1}{2!} \frac{1}{3} \left (-\frac{2}{3} \right ) x^2 + \frac{1}{3!} \frac{1}{3} \left (-\frac{2}{3} \right ) \left (-\frac{5}{3} \right ) x^3 + \ldots \\ \end{align} $$

so that

$$(1+x)^{1/3} - 1 = \frac{1}{3} x - \frac{1}{9} x^2 + \frac{5}{81} x^3 - \ldots$$

Ron Gordon
  • 138,521