kill(all)$

load packages,option
==================

load(lrats)$ ratprint:false$

maxima :first order pde for problem of the plane.
peter.vlasschaert@gmail.com,29/09/2021

goal : construct linear first order pde
=============================

ref :SPECIAL TOPICS  :
       6e) linear pde first order,pP+qQ=R            (2021) ,new,(18/05/2021)

rem : Software : Maxima & Geogebra ( info : youtube)
rem :pde = (p)artial (d)ifferential (e)quation
rem :{p,q} ,'see below'

 =============================

red (x-axis),green(y-axis),blue(z-axis) => angle (α),angle(β),angle(γ), point (G)=point on the plane.

Figure 1
=======

cartesian coordinaat =(x,y,z),plane green : (2*x+3y+5*z = 12),vector (0,D) = (2,3,5) perpendicular on the plane

rem : geogebra representation of the green plane.

define : partial differential for 'z' :(z to x) & (z to y)
----------------------------------------------------------------

pa1:p='diff(z,x);
pa1a:rhs(pa1)=lhs(pa1);
pa2:q='diff(z,y);
pa2a:rhs(pa2)=lhs(pa2);

1e) Theoretical Background
--------------------------------------

General equation of the plane :
========================

ordergreat(x,y,z)$

rem : https://stackoverflow.com/questions/36456544/how-to-order-variables-in-maxima
→  unorder()

pb1:a1*x+b1*y+c1*z+d1 = 0;

rem : 2*x+3y+5*z -12=0,see figure 1 'above'

pb1a:pb1-subst([x=0,y=0,z=0],lhs(pb1));

special plane :constant distance (-d1)=kk  from the origin.
rem : use (α,β,γ)

pb1b:subst ([-d1=kk],pb1a);

pb1c:[a1=cos(α),b1=cos(β),c1=cos(γ)];

rem :constraint on the plane

pb1d1:(pb1c)^2;

greatorder(α,β,γ)$

pb1e1a:sum(lhs(pb1d1[k]),k,1,length(pb1c))=1;
pb1e1b:sum(rhs(pb1d1[k]),k,1,length(pb1c))=1;

rem :use pb1c into  pb1b

pb1f:subst(pb1c,pb1b);

2e)  'find first  order pde of all planes ,which are @ fix distance 'kk'  from the origin' ?
----------------------------------------------------------------------------------------------------------------

→ 1e) step:elimination (c1 from pb1e1a)

pc1a :solve(pb1e1a,c1)[2];

→2e) step :put inside pb1b

pc1b:subst([pc1a],pb1b);

→3e) step partial differentation 'pc1b' with respect to x & y

depends(z,[x,y]);

pc1ca:diff(pc1b,x);
pc1ca1:ratcoeff(lhs(pc1ca),diff(z,x))*diff(z,x);
pc1ca2:pc1ca-pc1ca1;
pc1cb:diff(pc1b,y);
pc1cb1:ratcoeff(lhs(pc1cb),diff(z,y))*diff(z,y);
pc1cb2:pc1cb-pc1cb1;

→ 4e) step  : first order differentials, 'see above',{p,q}

pc1da:lratsubst(['diff(z,x)=p],pc1ca2);

pc1da1:pc1da/p;

pc1da2:rhs(pc1da1) = λ;

pc1da3:subst([pc1da2],pc1da1);

pc1da4:p*pc1da3;

pc1db:lratsubst(['diff(z,y)=q],pc1cb2);

pc1db1:pc1db/q;

pc1db2:rhs(pc1db1) = λ;

pc1db3:subst([pc1db2],pc1db1);

pc1db4:q*pc1db3;

pc1dd:[pc1da4,pc1db4];

→ 5e) step :use special equation: A/B=C/D = (A-C)/(B-D)

pc1e1: m1/m2=m3/m4;
pc1e2:lhs(pc1e1)= (m1-m3)/(m2-m4);
pc1e3:rhs(pc1e1)=rhs(pc1e2);

pc1e4a:[m1=num(lhs(pc1da1)),m2=denom(lhs(pc1da1))];

pc1e4b:[m3=num(lhs(pc1db1)),m4=denom(lhs(pc1db1))];

pc1e4:append(pc1e4a,pc1e4b);

pc1e1a:subst(pc1e4,pc1e1);
pc1e2a:subst(pc1e4,pc1e2);
pc1e3a:subst(pc1e4,pc1e3);

→6e) step : solve  λ use 5e) step 

pc1f1:pc1db2;

pc1f2:pc1dd;

pc1f3:subst(pc1f2,pc1f1);

before use solve : quadratic on both sides.

pc1f4:(pc1f3)^2;

pc1f5:solve(pc1f4,λ)[2];

→ 7e)  step  :final result  (use)

use :pc1b

pc1e1:lratsubst(pc1db2,pc1b);

use :pc1dd

pc1e2:subst(pc1dd,pc1e1);

use :pc1f5

pc1e3:expand(pc1e2/lhs(pc1f5));

result : first order pde : p =diff(z,x) & q=diff(z,y)
----------------------------------------------------------------

pc1e4:subst([pc1f5],pc1e3);

rem : other problems you can use :5e) step
rem  :constraint in the above problem.: trig identity.
=>  cos(γ)^2+cos(β)^2+cos(α)^2=1

Rem : Geogebra
How to find intersection : intersect(plane ,line)=intersect(green plane=eq1,line:f)
===============================================================
start : Geogebra    (2D  version:default open)
→1e step :  Menu → View → 3D Graphics
→2e step :  Input (after input use Enter:see Algebra 'section)
     example : input : 2*x+3*y+5*z = 12  put Enter key  ' input 'window' '
                       Algebra :
                       eq1: 2*x+3*y+5*z =12
                       A=(2,3,5)
                       B=(0,0,0)
→3e step : symbol for line : Menu  → select (cursor : A & cursor :B)
     result : plane & line on the screen (3D vieuw)
                      Algebra :
                      eq1: 2*x+3*y+5*z =12
                      A=(2,3,5)
                      B=(0,0,0)
                      f:X=(0,0,0)+λ*(2,3,5)
→4e step : intersection of the plane & line (=3D line)
                 method 1: menu
                 -----------------------
                 Menu :Point  A,  drop down menu 'intersect :symbol', need to select two objects 'line ,plane'
                 method 2:command 'geogebra'
                 --------------------------------------------
                 intersect(eq1,f)
                     Algebra :
                     eq1: 2*x+3*y+5*z =12
                     A=(2,3,5)
                     B=(0,0,0)
                     f:X=(0,0,0)+λ*(2,3,5)
                    C=(0.63,0.95,1.58)
rem :point of intersection(plane ,line) =C
===========================================================
Commands : Official GeoGebra Manual ( pdf :document  ,intersect :pg 66)
rem :construct f: line(B,A)

result from geogebra (C=intersection (plane,line))

How to find C: from geogeba.  (with Maxima)
===================================

→ to destroy λ from the above calculation

forget(λ);

λ;

qa1:2*x+3*y+5*z =12; /*equation of the plane:a1*x+b1*y+c1*z-d1=0 */
qa2:X=[0,0,0]+λ*[2,3,5];/*equation of the 3D line*/

rem : geogebra ()  → maxima []

→ X ? list for (x,y,z)

qa3x : x=rhs(qa2)[1];
qa3y : y=rhs(qa2)[2];
qa3z : z=rhs(qa2)[3];

qa3:[qa3x,qa3y,qa3z];

→ find  value :λ,use :qa1

qa4a:subst(qa3,qa1);

qa4:solve(qa4a,λ);

→ find intersection : C from Geogebra, use :qa3 & qa4

qa5a:C=subst(qa4,qa3);

qa5b:lhs(qa5a)=float(rhs(qa5a));

result: same as Geogebra , 'see : above'

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------