20200729, 08:08  #1 
Aug 2019
6_{10} Posts 
How to solve this equation with pari gp ...
I don't know how to put the solve command on the pari gp command line to solve logarithmic equations. Can somebody help me.

20200729, 12:06  #2 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}·3·79 Posts 
As I was taught by Paul Underwood,
To get log (x) in base n use log(x)/log(n) PariGP gives the natural log of the number otherwise known as ln(x) by the rest of the world. Last fiddled with by a1call on 20200729 at 12:14 
20200730, 07:31  #3 
Aug 2019
2×3 Posts 
I mean how to solve for example 2 ^ x 5 = 6. Using the solve command

20200730, 07:52  #4 
Jun 2003
1255_{16} Posts 
Code:
? ?solve solve(X=a,b,expr): real root of expression expr (X between a and b), where expr(a)*expr(b)<=0. 2^x5==0. We need to know an interval (a,b) where a root lies. We know that 2^2 < 5 < 2^3. So let's try (2,3) Code:
? solve(x=2, 3, 2^x5) %2 = 2.3219280948873623478703194294893901759 
20200730, 08:23  #5 
Aug 2019
2×3 Posts 
It would be solve(2^x=8); For example

20200730, 09:54  #6 
Jun 2003
1001001010101_{2} Posts 
No. You give a real valued expression in one variable, and it will find one realvalued solution where the expression becomes zero. So you recast your equation as 2^x8=0 and just give the left side of the equality as input.
Code:
? solve(t=0,10,2^t8) %1 = 3.0000000000000000000000000000000000000 
20200730, 12:04  #7  
"Robert Gerbicz"
Oct 2005
Hungary
1393_{10} Posts 
Quote:
Code:
? solve(x=0,3,if(x<2,1,1)) %3 = 1.9999999999999999999999999999999999999 ? 

20200730, 12:14  #8 
Aug 2019
2×3 Posts 
What I want to know is how is used solve command.

20200730, 13:56  #9 
Sep 2002
Database er0rr
2·1,697 Posts 
Code:
?solve solve(X=a,b,expr): real root of expression expr (X between a and b), where expr(a)*expr(b)<=0. Last fiddled with by paulunderwood on 20200730 at 14:26 
20200730, 14:45  #10 
"Robert Gerbicz"
Oct 2005
Hungary
1393_{10} Posts 
Good question, it is not binary search, it should be another root finding algorithm. Btw in some really trivial cases the solve breaks:
Code:
? solve(x=1,2,x^3) *** at toplevel: solve(x=1,2,x^3) *** ^ *** sorry, solve recovery [too many iterations] is not yet implemented. *** Break loop: type 'break' to go back to GP prompt break> Code:
? solve(x=1,2,print(x);x^3) 1.0000000000000000000000000000000000000 2.0000000000000000000000000000000000000 0.66666666666666666666666666666666666667 0.53132832080200501253132832080200501253 0.39585716304753417148752640416134559761 0.80207141847623291425623679791932720119 0.26729770261219306942169777701737070320 ... 4.1842288737629149621829297627585343823 E26 8.5184705351226720431227968573430956740 E26 2.8383161799160252299934361727339277773 E26 *** at toplevel: solve(x=1,2,print(x);x^3) *** ^ *** sorry, solve recovery [too many iterations] is not yet implemented. *** Break loop: type 'break' to go back to GP prompt 
20200731, 19:54  #11  
Jul 2020
1 Posts 
Quote:


Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to solve: k(b^m)z=n*d. ?  JM Montolio A  Miscellaneous Math  18  20180309 15:32 
The FBI wants YOU to help solve a murder  ixfd64  Puzzles  4  20110330 12:25 
Solve for mod function  flouran  Miscellaneous Math  23  20090104 20:03 
An Equation to Solve  davar55  Puzzles  3  20081009 00:35 
Solve this equation  davar55  Puzzles  52  20070626 21:41 