|
From: Barton W. <wi...@un...> - 2026-03-05 17:44:34
|
I think your code should quote k, kk, kkk and unsolved. Otherwise:
%i5) k : %pi/6$
(%i6) eq1 : 5^(3*x+2) = 7^(3*x+2);
(eq1) 5^(3*x+2)=7^(3*x+2)
(%i7) complex_solution(eq1, x);
(%o7) x=-((%i*%pi^2)/(9*log(7/5)))-2/3
Alternatively, you might like to consider using a gensym variable (see user documentation).
________________________________
From: Matthias A.Steiner <mat...@we...>
Sent: Wednesday, March 4, 2026 11:26 PM
To: Barton Willis <wi...@un...>; Max...@li... <Max...@li...>
Subject: Re: [Maxima-discuss] Why can't Maxima solve 5^(3*x+2) = 7^(3*x+2) symbolically? PEBCAK or a limitation?
Caution: Non-NU Email
Dear Barton,
Thanks for your spot-on comments, which I tried to apply in v1.0.2. I’ve attached the file below. Here's what it does.
(%i1) kill(all)$
(%i1) load("all_exp_eq_solutions_v1.0.2.mac")$
(%i2) eq1: 5^(3*x+2) = 7^(3*x+2)$
(%i3) sols1: all_solutions(eq1, x)$
(%i4) real(eq1, x);
(%o4) x=-(2/3)
(%i5) complex(eq1, x);
(%o5) x=-((2*i*π*k)/(3*log (7/5)))-2/3
(%i6) complex_report(eq1, x);
(%o6) [x=-((2*i*π*k+2*log (7)-2*log (5))/(3*log (7)-3*log (5))),x=-((2*i*π*k)/(3*log (7/5)))-2/3]
(%i7) eq2: 5^(3*k+2) = 7^(2*k+2)$
(%i8) sols2: all_solutions(eq2, k)$
(%i9) real_solution(eq2, k);
(%o9) k=-((2*log (7)-2*log (5))/(2*log (7)-3*log (5)))
(%i10) complex(eq2, k);
(%o10) k=-((2*i*π*kk+2*log (7)-2*log (5))/(2*log (7)-3*log (5)))
(%i11) complex_report(5^(3*k+2) = 7^(3*k+2), k);
%o11) [k=-((2*i*π*kk+2*log (7)-2*log (5))/(3*log (7)-3*log (5))),k=-((2*i*π*kk)/(3*log (7/5)))-2/3]
(%i12) eq3: 5^(3*x+2) = 7^(2*x+1)$
(%i13) sols3: all_solutions(eq3, x)$
(%i14) real_solution(eq3, x);
(%o14) x=-((log (7)-2*log (5))/(2*log (7)-3*log (5)))
(%i15) complex_solution(eq3, x);
(%o15) x=-((2*i*π*k+log (7)-2*log (5))/(2*log (7)-3*log (5)))
(%i16) complex_report(eq3, x);
(%o16) x=-((2*i*π*k+log (7)-2*log (5))/(2*log (7)-3*log (5)))
(%i17) complex(5^(3*x+2) + 1 = 7^(3*x+2), x);
#0: all_solutions_k(eq=5^(3*x+2)+1 = 7^(3*x+2),x=x,ksym=k) (all_exp_eq_solutions_v1.0.2.mac line 95)
#1: all_solutions(eq=5^(3*x+2)+1 = 7^(3*x+2),x=x) (all_exp_eq_solutions_v1.0.2.mac line 121)
#2: complex_solution(eq=5^(3*x+2)+1 = 7^(3*x+2),x=x) (all_exp_eq_solutions_v1.0.2.mac line 141)
all_solutions: expected LHS to be a power a^u. Got LHS = 5^(3*x+2)+1
-- an error. To debug this try: debugmode(true);
(%i18) try_complex(5^(3*x+2) + 1 = 7^(3*x+2), x);
all_solutions: expected LHS to be a power a^u. Got LHS = 5^(3*x+2)+1
(%o18) unsolved
Any suggestions or comments are more than welcome.
Cheers, Tilda
Am 04.03.2026 um 16:03 schrieb Barton Willis <wi...@un...>:
I tried the code in all_exp_eq_solutions_v0.2.6.mac. Some comments:
When the solve variable is k, the result is an expression that has k with two meanings:
(%i7) complex(5^(3*k+2) = 7^(3*k+2),k);
(%o7) k=-((2*%i*%pi*k)/(3*log(7/5)))-2/3
When the base of the exponential isn't a constant, the result isn't wrong, but the equation isn't solved:
(%i8) complex(x^(3*x+2) = 7^(3*x+2),x);
(%o8) x=-((2*%i*%pi*k)/(3*log(7/x)))-2/3
The code assumes a very specific set of equations; when it isn't, the user gets a hard to understand error message:
(%i11) complex(5^(3*x+2) + 1 = 7^(3*x+2),x);
pow_parts: expected a power a^e, got: 5^(3*x+2)+1
The function complex_report uses simp as a local variable. But simp is a Maxima option variable—when it is false, Maxima doesn't simplify expressions, and much of Maxima will not work as expected. Likely, you should name this local variable something else.
I hope these comments might help make your code better -- please keep us up on your efforts.
--Barton
|