0

I have been using tools such as WolframAlpha to solve a series of equations. I've recently come across an equation which the computers seemingly aren't able to solve. I'd like to know what about this equation makes it unsolveable by computers and what the answer is if one exists.

I'm attempting to solve $$AB+1=B^C$$ for B. How can B be written as a function of A and C?

Kyan Cheung
  • 3,184
  • 3
    Here's a counter question: Why would you expect it to be solvable analytically? – Rushabh Mehta Mar 15 '20 at 04:54
  • 1
    Are $(a,b,c)$ all positive ? Is $b$ supposed to be small ? Give some orders of magnitude. – Claude Leibovici Mar 15 '20 at 04:58
  • @DonThousand, I suppose my limited understanding of mathematics assumed that any multivariable equation could be solved for a single variable. I've never come across an equation that hasn't been, so this is new for me. Can you provide any provide any resources describing similar equations and explaining why they can't be solved this way? – Jumblemuddle Mar 15 '20 at 15:48
  • @ClaudeLeibovici, A will be a large positive integer (e.g. 10,000), B will be a percentage (e.g. 0.05), and C will be a small positive integer (e.g. 20). – Jumblemuddle Mar 15 '20 at 15:52

2 Answers2

0

There is no analytical solution to finding $B$. However, you can rewrite the equation as $f(B)=B^C-AB-1=0$. After that, we note that the derivative with respect to $B$ is $f'(B)=CB^{C-1}-A$. Therefore, we can use Newton's method to calculate $B$, and we have $$B_{n+1}=B_n-\frac{B_n^C-AB-1}{CB_n^{C-1}-A}$$ This is an example of using a spreadsheet to get B.

Kyan Cheung
  • 3,184
  • I've never run across an equation which must be solved like this. In this particular case, I'm attempting to create a cell in a spreadsheet (Google Sheets) which will contain the value of B given A and C. If I rewrite the full equation to be equal to 0, are there functions within spreadsheets which can perform Newton's method. (I'm just now learning about Newton's method.) – Jumblemuddle Mar 15 '20 at 15:54
  • @Jumblemuddle I've made a spreadsheet template to find B here. – Kyan Cheung Mar 16 '20 at 08:11
  • Thanks, @Kyky, I'm still trying to figure out how this might be done in a single cell of a spreadsheet. This does help point me in the right direction though. :) – Jumblemuddle Mar 17 '20 at 14:35
  • @Jumblemuddle I've noted that since $f(B)\approx-AB-1$ for small $B$, that means that when $B=-\frac1A$, $f(B)$ is close to $0$ so you can just take that as B. Also, it turns out that the Google Spreadsheet was just raw data so I've added the actual formulae now. – Kyan Cheung Mar 17 '20 at 15:14
  • Thanks, @Kyky, I've ended up implementing Newton's method using a custom function in Google Sheets. I appreciate you pointing me in the right direction. :) – Jumblemuddle Mar 19 '20 at 04:43
0

You obviously understood that there is no way to get an explicit solution. So, we shall work approximations.

Changing notations $a=A$, $x=B$, $c=C$, we look for the zero of function $$f(x)=a x+1-x^c$$ for which $$f'(x)=a - c x^{c-1} \qquad \text{and} \qquad f''(x)=-c(c-1)x^{c-2} \,\, <0 \quad \forall x$$

Starting at $x=0$ $(f(0)=1)$, the function goes through a maximum (by the second derivative test). $$f'(x)=0 \implies a-c x_*^{c-1}\implies x_*=\left(\frac{a}{c}\right)^{\frac{1}{c-1}}$$

There is another point where $f(x)=1$; it is given by $$x_0=a ^{\frac{1}{c-1}}$$

Now, expand $f(x)$ as a Taylor series around $x=x_0$; this will give $$f(x)=f(x_0)+f'(x_0) (x-x_0)+\frac 12 f''(x_0)(x-x_0)^2+\frac 16 f'''(x_0)(x-x_0)^3+ \cdots$$ that, for conveniency for the next, we shall write $$f(x)=\sum_{i=0}^n \alpha_i (x-x_0)^i\qquad \text{where} \qquad \alpha_i=\frac{f^{(n)}(x_0)}{i!}$$ Now, we can use series reversion to get (again as an estimate) $$x=x_0+t-\frac{\alpha_2 }{\alpha_1}t^2+\frac{2 \alpha_2^2-\alpha_1 \alpha_3 }{\alpha_1^2}t^3+\frac{-5 \alpha_2^3+5 \alpha_1 \alpha_3 \alpha_2-\alpha_1^2 \alpha_4 }{\alpha_1^3}t^4+O(t^5)$$ where $t=-\frac{\alpha_0}{\alpha_1}$

Example

Trying with you data $a=10000$ and $c=20$,we shall have $$x_0=10^{4/19}=1.62378$$ $$x=10^{4/19}+\frac{1}{190000}-\frac{1}{3610000000\ 10^{4/19}}+\frac{7 }{342950000000000\ 10^{8/19}}-\frac{451 }{260642000000000000000\ 10^{12/19}}\approx 1.62378200217602921028663$$ while the exact solution, given by Newton method, is $1.62378200217602921028665$. Not too bad (I hope !). For sure, for pratical purpose, you do not need so meny terms and probably the first and second terms would be more than sufficient (I just wanted to show that we can get almost the exact solution at the price of very few operations).

Continued

There is another way to get another approximation at the price of a small loss of accuracy; it is based on Padé approximants. Limited to the simplest one, this would write $$x=x_0+\frac{\alpha_0\,\alpha_1}{\alpha_0\, \alpha_2-\alpha_1^2}=x_0+\frac{\alpha_1}{\alpha_2-\alpha_1^2}$$ Applied to the worked example, this would give $x=1.6237820020$ which is more than sufficient.

Edit

For a more than reasonable approximation, use $$x= a ^{\frac{1}{c-1}} +\frac{1}{a (c-1)} $$ For testing with $c=20$, let $a=10^k$ and get the following results $$\left( \begin{array}{ccc} k & \text{estimate} & \text{solution} \\ 1 & 1.134101050 & 1.133870562 \\ 2 & 1.274801301 & 1.274799140 \\ 3 & 1.438502520 & 1.438502501 \\ 4 & 1.623782002 & 1.623782002 \\ 5 & 1.832981237 & 1.832981237 \\ 6 & 2.069138134 & 2.069138134 \\ 7 & 2.335721474 & 2.335721474 \\ 8 & 2.636650899 & 2.636650899 \end{array} \right)$$

  • I appreciate your taking the time to write this up. If I'm being honest, I understand very little of it, however it does help shed some light on the topic. In this particular case, I'm only looking for a very rough approximation, so I do appreciate you pointing me in the direction of some algorithms that might do that. – Jumblemuddle Mar 17 '20 at 14:36
  • @Jumblemuddle. Have a look at my edit. – Claude Leibovici Mar 18 '20 at 10:38
  • Thanks! I appreciate your help. – Jumblemuddle Mar 19 '20 at 04:43