Rev 16209 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !set methtit=Direct change of variable |
2 | !set methenv=ZZ QQ RR |
||
3 | !set methparmtype=parm function integrate, function |
||
16135 | bpr | 4 | !set methhelp=This method applies the change of variable \ |
5 | on an indefinite integral. |
||
20 | reyssat | 6 | |
7 | !if $wims_read_parm iswordof form check |
||
16135 | bpr | 8 | !goto $wims_read_parm |
20 | reyssat | 9 | !endif |
10 | |||
11 | !exit |
||
12 | :form |
||
16120 | bpr | 13 | !set N=!linecnt $mtobj1 |
14 | !if $N>1 and $methsubstep=1 |
||
20 | reyssat | 15 | :first |
16 | !set methsubstep=2 |
||
17 | Apply a change of variable for: <p> |
||
18 | !read deduc/methparm.phtml 1 |
||
16120 | bpr | 19 | !else |
20 | reyssat | 20 | !bound methparm1 between integer 0 and $N default 1 |
21 | !if $methparm1=0 or $error!=$empty |
||
16209 | bpr | 22 | !goto first |
20 | reyssat | 23 | !endif |
17187 | bpr | 24 | <input type="hidden" name="methparm1" value="$methparm1"> |
20 | reyssat | 25 | !set methsubstep=1 |
26 | !set l=!line $methparm1 of $mtobj1 |
||
27 | !set l=!item 2 to -1 of $l |
||
28 | !set k=!mathsubst integrate= in $l |
||
29 | !set k=!declosing $k |
||
30 | !set v=!item 2 of $k |
||
31 | !set nvar=!item 1 of $newvariables |
||
32 | Change of variable: |
||
16135 | bpr | 33 | <div class="wimscenter"> |
34 | \($l = integrate(f($v),$v) = integrate(f(h($nvar))h'($nvar),$nvar)) , |
||
5763 | bpr | 35 | </div> |
20 | reyssat | 36 | with |
37 | \($v = h($nvar) = ) |
||
38 | !read deduc/methparm.phtml 2,36 |
||
39 | . |
||
16120 | bpr | 40 | !endif |
20 | reyssat | 41 | !exit |
42 | :check |
||
16120 | bpr | 43 | ker=!item 2 of $methparmobj1 |
44 | ker=!mathsubst integrate= in $ker |
||
45 | ker=!trim $ker |
||
46 | ker=!declosing $ker |
||
47 | !distribute items $ker into iker,ivar |
||
48 | vartest=!varlist $ivar |
||
49 | !if $ivar != $vartest |
||
20 | reyssat | 50 | error=Fail |
51 | !exit |
||
16120 | bpr | 52 | !endif |
20 | reyssat | 53 | |
16120 | bpr | 54 | newvar=!item 1 of $newvariables |
55 | vv=!varlist nofn $methparm2 |
||
56 | vtest=!listcomplement $newvar,e,pi,euler in $vv |
||
57 | !if $vtest!=$empty |
||
20 | reyssat | 58 | error=\($methparm2) must be a function of \($newvar) only. |
59 | !exit |
||
16120 | bpr | 60 | !endif |
61 | diff=!exec maxima diff($methparm2,$newvar); |
||
62 | !if $diff=$empty |
||
20 | reyssat | 63 | :bad_data |
64 | error=bad_data |
||
65 | !exit |
||
16120 | bpr | 66 | !endif |
67 | inv=!exec maxima solve($ivar=$methparm2,$newvar); |
||
68 | inv=!declosing $inv |
||
69 | n=!itemcnt $inv |
||
70 | inv2=!nospace $inv |
||
71 | eq== |
||
72 | !if $n!=1 or +++**$newvar$eq notin +++**$inv2 |
||
20 | reyssat | 73 | error=Impossible to find the inverse function of $methparm2, which is\ |
16135 | bpr | 74 | for future substitution:\ |
75 | use the reverse change of variable. |
||
20 | reyssat | 76 | !exit |
16120 | bpr | 77 | !endif |
16135 | bpr | 78 | substed=!mathsubst $ivar=($methparm2) in $iker |
79 | !read deduc/sub/checkzero diff(($substed)*($diff),$newvar) |
||
80 | difftest=$out |
||
81 | !read deduc/sub/simplify ($substed)*($diff)\ |
||
20 | reyssat | 82 | ($substed)*($diff)*$newvar |
16120 | bpr | 83 | !distribute lines $out into newker,ktest |
84 | !if $newker=$empty or $ktest=$empty or $difftest=$empty |
||
20 | reyssat | 85 | !goto bad_data |
16120 | bpr | 86 | !endif |
87 | |||
88 | !if strictintegrate iswordof $m_options and $difftest=yes |
||
20 | reyssat | 89 | error=This change of variable is not allowed for this environment.\ |
16135 | bpr | 90 | Please change the method. |
20 | reyssat | 91 | !exit |
16120 | bpr | 92 | !endif |
20 | reyssat | 93 | |
16120 | bpr | 94 | !if $difftest=yes |
20 | reyssat | 95 | newobject1=$ktest |
16120 | bpr | 96 | !else |
20 | reyssat | 97 | newobject1=integrate($newker,$newvar) |
16120 | bpr | 98 | !endif |
99 | newobject0=$inv |
||
100 | oldobject=0,1 |
||
101 | methexp=\($ivar=$methparm2) |
||
102 | variables=$variables,$newvar |
||
20 | reyssat | 103 | !exit |