|
From: Barton W. <wi...@un...> - 2025-11-23 18:32:19
|
Guess: funcsolve doesn't properly check that solve returned an empty solution, making all the unknowns, including %0 undetermined. My evidence: (%i2) trace(solve); (%o2) [solve] Here solve returns the empty list, but it goes ahead and returns a bogus solution: %i3) funcsolve((n+1)*f(n)-(n-1)*f(n-1)=(n+1)/(n-1),f(n)); 1" Enter "solve" "[[%1-%0-1,2*%2-2*%1+4*%0-1,-%2+3*%1-5*%0,4*%0-%1,-%0],[%2,%1,%0]] 1" Exit "solve" "[] (%o3) f(n)=(%0*n^2+%1*n+%2)/((n-1)*(n+1)) Here solve finds a solution and returns a correct solution: (%i4) funcsolve(f(n+1) - f(n) = (n^2+5*n+1)/((n+2)*(n+3)),f(n)); 1" Enter "solve" "[%+1,%] 1" Exit "solve" "[%=-1] 1" Enter "solve" "[%-1,%] 1" Exit "solve" "[%=1] 1" Enter "solve" "[[-%2+2*%1+2*%0-1,5*%0-5,%0-1],[%2,%1,%0]] solve: dependent equations eliminated: (3) 1" Exit "solve" "[[%2=%r1,%1=(%r1-1)/2,%0=1]] (%o4) f(n)=(2*n^2+%r1*n-n+2*%r1)/(2*(n+2)) Maybe you could file a bug report—even better, maybe you could fix the bug too. ________________________________ From: Daniel Volinski via Maxima-discuss <max...@li...> Sent: Sunday, November 23, 2025 10:02 AM To: max...@li... <max...@li...> Subject: [Maxima-discuss] Fail to understand result of funcsolve Caution: Non-NU Email Hi All, I have the following lines: eq:(n+1)*f(n)-(n-1)*f(n-1)=(n+1)/(n-1); funcsolve(eq,f(n)); I get the following result: (n+1)*f(n)-f(n-1)*(n-1) = (n+1)/(n-1) f(n) = (%0*n^2+%1*n+%2)/((n-1)*(n+1)) What is the meaning of %0, %1, %2 in this result? Thanks, Daniel Volinski |