this gives the correct answer:
solve([x²+y²=r², (x-a)²+(y)²=p²],[x,y]);
[[x=(r^2-p^2+a^2)/(2*a),y=-sqrt(-r^4+2*p^2*r^2+2*a^2*r^2-p^4+2*a^2*p^2-a^4)/(2*a)],[x=(r^2-p^2+a^2)/(2*a),y=sqrt(-r^4+2*p^2*r^2+2*a^2*r^2-p^4+2*a^2*p^2-a^4)/(2*a)]]
but this give an empty solution:
solve([x²+y²=r², (x-a)²+(y-b)²=p²],[x,y]);
[]
(%i2) eq1:x^2+y^2=r^2$
eq2:(x-a)^2+(y-b)^2=p^2$
(%i3) sol:solve([eq1,eq1-eq2],[x,y]);
(sol)
[[x=-(bsqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)-ar^2+ap^2-ab^2-a^3)/(2b^2+2a^2),y=(asqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)+br^2-bp^2+b^3+a^2b)/(2b^2+2a^2)],[x=(bsqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)+ar^2-ap^2+ab^2+a^3)/(2b^2+2a^2),y=-(asqrt(-r^4+(2p^2+2b^2+2a^2)r^2-p^4+(2b^2+2a^2)p^2-b^4-2a^2b^2-a^4)-br^2+bp^2-b^3-a^2b)/(2b^2+2a^2)]]
Test:
(%i4) subst(sol[1],[eq1,eq2]),radcan;
(%o4) [r^2=r^2,p^2=p^2]
(%i5) subst(sol[2],[eq1,eq2]),radcan;
(%o5) [r^2=r^2,p^2=p^2]
2018-03-23 10:29 GMT+02:00 Jack Samhain jacksamhain@users.sourceforge.net:
Related
Bugs: #3414
Ok, found it: I have here these versions from the debian repository:
maxima 5.38.1-8+b1
wxmaxima 16.04.2-1
"maxima" gives the correct result, just like you quoted.
"wxmaxima" gives the incorrect result.
So this is a bug in wxmaxima, not maxima.
Did not work out so well. Afterupgrading ti the latest supported version I get reliably this result:
(%i9) eq1:x²+y²=r²$
eq2:(x-a)²+(y+b)²=d²$
solve([eq1,eq2],[x,y]);
(%o9) []
This happens on maxima 5.38.1-8+b1 (devuan) and 5.41.0 (FreeBSD).
I'll take this one.
solve calls algsys to solve systems of polynomial equations. The problem here is (probably) too general for algsys. If some parameters are given values then solutions are found. I will investigate a little further but it is probably a wont-fix.
What I recommend for this type of problem is to use geometric insight to eliminate some degrees of freedom. The problem as posed is the intersection of a circle centre (0.0) radius r and a circle centre (a,-b) radius d. By rotating and scaling you can transform the problem to the system of equations at (%i8) which is solvable.
You are right, one can take the solver by it's hand and make it solve the equations, but that is not the point: The solver fails at this simple problem. How should the user trust the solver to work correctly, when it can not solve a perfectly solvable problem? It's a pitty, but in my case it disqualifies maxima for use in classes.
My old TI-92 solves this equations the correct way :)