3

I've recently been intrigued by calculating decimal and fractional powers. An example is $5^{3.5}$. I can break this into $5*5*5*5^{1/2}$, but how would I express this or find the answer without using square roots? I'm not very experienced in mathematics and haven't taken precalc yet, so I asked my teacher. She said it's impossible without square roots, but if that were true calculators wouldn't be able to get the answer. What steps would I have to take to try to solve this without using square roots?

Aeon
  • 33
  • 4
  • 4
    A calculator can just as easily calculate $5^{2.74835}$, so it's not going to bother with the special case of square roots - they almost certainly use logarithms. – JonathanZ Apr 03 '23 at 20:02
  • 1
    And for the second part of your question ("how could I do it with pen and paper?"): You would get yourself a table of logarithms and learn how to use it. – JonathanZ Apr 03 '23 at 20:05
  • 1
    @JonathanZsupportsMonicaC A lot of floating point units have sqrt as a native instruction, so calculators probably do special case it in practice. – eyeballfrog Apr 03 '23 at 20:22
  • There is a long division-like algorithm for finding square roots. It's impractical if you want a lot of digits, but it'll get the first few just fine. – eyeballfrog Apr 03 '23 at 20:25
  • @eyeballfrog - Yeah, and there's often a "$\sqrt x$" key, that might do use that specialized instruction, but if you're hitting "$y^x$", I doubt it would check for the "half-integer" special case, like in the example given. – JonathanZ Apr 03 '23 at 20:35
  • From your reasoning, a calculator can compute $~\sqrt{2}.~$ However, this is clearly not the case, because a calculator is limited by the number of significant digits that it can incorporate into an answer. That is, since the $~\sqrt{2}~$ is an irrational number, it's decimal representation has an infinite number of decimal places. – user2661923 Apr 03 '23 at 20:57
  • it used to be that they used something which is called "Polish notation". I believe that the name comes from a Polish logician, may be Lukaszewicz. The idea is to put all operation on stack first and then unwind it and compute step by step. Not sure if this approach is still used though. – Salcio Apr 03 '23 at 23:49
  • 1
    Does this answer your question? How do pocket calculators calculate exponents? In this particular case your teacher is almost surely wrong when she says calculators find a square root first to find $5^{3.5}$. – Ethan Bolker Apr 04 '23 at 00:10
  • Everything that a calculator can compute can be computed by hand, just slower. – Dan Apr 04 '23 at 00:21
  • Related: https://math.stackexchange.com/questions/132703/what-does-2x-really-mean-when-x-is-not-an-integer/ – Dan Apr 04 '23 at 00:22

1 Answers1

5

The most likely method that calculators would use for exponentiation is via a logarithmic transformation. For example, to calculate $5^{3.5}$, the calculator would do something resembling the following:

  1. Find $\ln 5 \approx 1.609$

  2. Calculate $3.5 \times 1.609 = 5.6315$

  3. Calculate $e^{5.6315} \approx 279.08$

To calculate the logarithms and exponentials, there are many methods available (see, e.g. this question), but one way is to use Taylor series approximations:

$\begin{eqnarray} \ln (1 + x) & = & x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \ldots \\ e^x & = & 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24} + \ldots \end{eqnarray}$

and there are tricks to making these converge very quickly so the calculator only needs to perform a few operations to get a high accuracy.

This is not too different to how people used to perform these calculations before electronic or even mechanical calculators were common. They would either use a slide rule, which used logarithmic scales to automatically perform steps 1 and 3 so that the addition of lengths results in a multiplication of values, or would reference a table of logarithmic values that were pre-computed.

ConMan
  • 24,300
  • For your answer about calculators, wouldn't $e^{5.6315}$ also have to be calculated the same way causing an infinite loop of multiplying the exponent by $1$? – Aeon Apr 04 '23 at 16:45
  • 1
    So if you have a log table, you can calculate $e^x$ by looking for $x$ in the table of values and just finding what input generates it. And if you're a computer, you calculate $e^x$ using the Taylor series as I showed there, which reduces the problem to one of additions and multiplications. It's all about converting things to base $e$ so that every calculation happens on a consistent basis. – ConMan Apr 04 '23 at 23:41