0

Please help me solve this problem. I have a difficult time understanding my professor and need assistance on my homework assignment so I can be prepared when the exam comes. The question is as follows-

Explain how to evaluate the following functions accurately for small $x$

a) $\left[{1\over(1+2x)}\right]+\left[{(1-x)\over(1+x)}\right]$

b) $\sqrt{({1\over x})+x}−\sqrt{({1\over x})-x}$

c) $\operatorname{sinh}(x) = [e^x−e^{-x}]/2$

hardmath
  • 37,015
BCarey
  • 1
  • 2
    It would help if you explain what kind of techniques you are covering in your course. Otherwise an answer like: "Go to such and such website and enter the expressions along with desired values of x" would represent a simple/good answer. – Χpẘ Sep 20 '17 at 15:14
  • @mega6382: to put multicharacter items under the square root sign, enclose them in braces. For example \sqrt {a+b} gives $\sqrt {a+b}$. It works everywhere, like for numerators and denominators, exponents, subscritpts, etc. – Ross Millikan Sep 20 '17 at 15:22
  • @RossMillikan Thank you, for informing me. – mega6382 Sep 20 '17 at 15:23
  • You should avoid subexpressions which are sensitive to small modifications. Modify them, it is better to add two small values then subtract one from the other for example. – z100 Sep 20 '17 at 15:25

1 Answers1

1

The basic idea is to avoid loss of precision when subtracting two nearly equal quantities. This should be a major theme of your course. A simple example is computing $1-(1-x)$ for small $x$. If you compute it as written you will lose many bits of $x$ from the first subtraction. Try it in your environment for $x=10^{-10}, 10^{-20}, 10^{-30}$. In my Excel I get zero for $1-(1-x)$ at $x=10^{-10}$. The fix is to analytically cancel the large term, replacing $1-(1-x)$ with $x$. You can use Taylor series, because when $x$ is small they converge very rapidly.

Ross Millikan
  • 374,822