Rename *ll* and *ul* to ll and ul in defint-list
[maxima.git] / share / contrib / conics_04-context.txt
blob412d2f7aaa3ce53eda4c8e8ff1dc8470226b5526
1 Comments by David Billinghurst to maxima-discuss, 2021-09-02, about conics_04.mac:
3 <quote>
4 Here is one way to solve the problem in maxima.
6 A colleague needed to find the intersection of two conics in C code. I used maxima to eliminate y
7 symbolically from the two conic equations, leaving a quartic polynomial in x. We then substituted
8 numerical values of the coefficients, solved the quartic then back-substituted to find y.
10 It is possible to solve the quartic exactly, rather than numerically. This is usually a bad idea.
12 For example, one of the quartic polynomials in the examples below is
14 p:(45*x^4)/128-(135*x^3)/64+(675*x^2)/64-(2475*x)/128+5445/512;
16 solve(p,x) gives roots like
18 x = (-sqrt((16*sqrt(3)*((88*sqrt(38))/3^(3/2)+197)^(1/6))
19                      /sqrt(3*((88*sqrt(38))/3^(3/2)+197)^(2/3)
20 -33*((88*sqrt(38))/3^(3/2)+197)^(1/3)+91)
21                      -((88*sqrt(38))/3^(3/2)+197)^(1/3)
22 -91/(3*((88*sqrt(38))/3^(3/2)+197)^(1/3))-22)
23            /2)
24            -sqrt(3*((88*sqrt(38))/3^(3/2)+197)^(2/3)
25                   -33*((88*sqrt(38))/3^(3/2)+197)^(1/3)+91)
26             /(2*sqrt(3)*((88*sqrt(38))/3^(3/2)+197)^(1/6))+3/2
28 Back-substituting this to solve for y leads to large and useless equations, even for rational coefficients. Try it. The problem is many, many, many times worse with symbolic coefficients.
30 Remember the code below was structured to give the formulae for the coefficients of the quartic polynomial. There are other ways to structure the calculation.
32 Run the code using batch("conics_04.mac") or demo("conics_04.mac")
33 </quote>