|
From: rtoy <rt...@us...> - 2025-09-04 22:53:32
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-trigtools-update-examples has been created
at a432b864aaf9d7f60af4be10ae67235b739e88b1 (commit)
- Log -----------------------------------------------------------------
commit a432b864aaf9d7f60af4be10ae67235b739e88b1
Author: Raymond Toy <toy...@gm...>
Date: Thu Sep 4 15:52:08 2025 -0700
Add more comment blocks for examples and regenerate them
There are still many left to do.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index cb46c63d4..11ab4969e 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -600,21 +600,42 @@ m4_mathdot(<<<[a,b)>>>, <<<[a, b)>>>)
Examples:
@enumerate
@item @w{ }
-@example
-(%i38) eq:eq:3*sin(x)+4*cos(x)=2;
-(%o38) 3 sin(x) + 4 cos(x) = 2
-
-(%i39) plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+@c ===beg===
+@c eq:eq:3*sin(x)+4*cos(x)=2;
+@c plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+@c ===end===
+@example maxima
+@group
+(%i1) eq:eq:3*sin(x)+4*cos(x)=2;
+(%o1) 3 sin(x) + 4 cos(x) = 2
+@end group
+@group
+(%i2) plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+(%o2) false
+@end group
+@end example
@center @image{figures/trigtools-2,5in,,plot2}
-(%o39)
-(%i40) sol:trigsolve(eq,-%pi,%pi);
- 2 sqrt(21) 12 2 sqrt(21) 12
-(%o40) @{atan(---------- - --), %pi - atan(---------- + --)@}
- 5 5 5 5
-(%i41) float(%), numer;
-(%o41) @{- 0.5157783719341241, 1.802780589520693@}
+@c ===beg===
+@c load("trigtools")$
+@c eq:eq:3*sin(x)+4*cos(x)=2$
+@c sol:trigsolve(eq,-%pi,%pi);
+@c float(%), numer;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:eq:3*sin(x)+4*cos(x)=2$
+@group
+(%i3) sol:trigsolve(eq,-%pi,%pi);
+ 2 sqrt(21) 12 2 sqrt(21) 12
+(%o3) @{atan(---------- - --), %pi - atan(---------- + --)@}
+ 5 5 5 5
+@end group
+@group
+(%i4) float(%), numer;
+(%o4) @{- 0.5157783719341241, 1.8027805895206928@}
+@end group
@end example
Answ. :
@@ -627,70 +648,147 @@ m4_mathcomma(<<<x = \pi - \tan^{-1}\left({2\sqrt{21}\over 5} +
@math{k} -- any integer.
@item @w{ }
-@example
-(%i6) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x));
-(%o6) cos(3 x) - sin(x) = sqrt(3) (cos(x) - sin(3 x))
-(%i7) plot2d([lhs(eq)-rhs(eq)], [x,0,2*%pi])$
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x));
+@c plot2d([lhs(eq)-rhs(eq)], [x,0,2*%pi])$
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x));
+(%o2) cos(3 x) - sin(x) = sqrt(3) (cos(x) - sin(3 x))
+@end group
+(%i3) plot2d([lhs(eq)-rhs(eq)], [x,0,2*%pi])$
+@end example
@center @image{figures/trigtools-3,5in,,plot3}
-@end example
-
We have 6 solutions from [0, 2*pi].
-@example
-(%i8) plot2d([lhs(eq)-rhs(eq)], [x,0.2,0.5]);
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c plot2d([lhs(eq)-rhs(eq)], [x,0.2,0.5])$
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+(%i3) plot2d([lhs(eq)-rhs(eq)], [x,0.2,0.5])$
+@end example
@center @image{figures/trigtools-4,5in,,plot4}
-(%i9) plot2d([lhs(eq)-rhs(eq)], [x,3.3,3.6]);
+@c ===beg===
+@c load("trigtools")$
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c plot2d([lhs(eq)-rhs(eq)], [x,3.3,3.6])$
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) load("trigtools")$
+(%i3) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+(%i4) plot2d([lhs(eq)-rhs(eq)], [x,3.3,3.6])$
+@end example
@center @image{figures/trigtools-5,5in,,plot4}
-(%i10) trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
- %pi %pi %pi %pi
-(%o15) - 2 sin(x + ---) sin(2 x - ---) = 2 sqrt(3) sin(x - ---) sin(2 x - ---)
- 4 4 4 4
-(%i11) factor(lhs(%)-rhs(%));
- 4 x + %pi 4 x - %pi 8 x - %pi
-(%o11) - 2 (sin(---------) + sqrt(3) sin(---------)) sin(---------)
- 4 4 4
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+@c factor(lhs(%)-rhs(%));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@group
+(%i3) trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+ %pi %pi
+(%o3) - 2 sin(x + ---) sin(2 x - ---) =
+ 4 4
+ %pi %pi
+ 2 sqrt(3) sin(x - ---) sin(2 x - ---)
+ 4 4
+@end group
+@group
+(%i4) factor(lhs(%)-rhs(%));
+ 4 x + %pi 4 x - %pi
+(%o4) - 2 (sin(---------) + sqrt(3) sin(---------))
+ 4 4
+ 8 x - %pi
+ sin(---------)
+ 4
+@end group
@end example
Equation is equivalent to
-@example
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+@c L:factor(rhs(%)-lhs(%));
+@c eq1:part(L,2)=0;
+@c eq2:part(L,3)=0;
+@c S1:trigsolve(eq1,0,2*%pi);
+@c S2:trigsolve(eq2,0,2*%pi);
+@c S:listify(union(S1,S2));
+@c float(%), numer;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@group
+(%i3) trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+ %pi %pi
+(%o3) - 2 sin(x + ---) sin(2 x - ---) =
+ 4 4
+ %pi %pi
+ 2 sqrt(3) sin(x - ---) sin(2 x - ---)
+ 4 4
+@end group
+@group
+(%i4) L:factor(rhs(%)-lhs(%));
+ 4 x + %pi 4 x - %pi 8 x - %pi
+(%o4) 2 (sin(---------) + sqrt(3) sin(---------)) sin(---------)
+ 4 4 4
+@end group
+@group
+(%i5) eq1:part(L,2)=0;
+ 4 x + %pi 4 x - %pi
+(%o5) sin(---------) + sqrt(3) sin(---------) = 0
+ 4 4
+@end group
@group
-(%i12) L:factor(rhs(%)-lhs(%));
- 4 x + %pi 4 x - %pi 8 x - %pi
-(%o12) 2 (sin(---------) + sqrt(3) sin(---------)) sin(---------)
- 4 4 4
-@end group
-@group
-(%i13) eq1:part(L,2)=0;
- 4 x + %pi 4 x - %pi
-(%o13) sin(---------) + sqrt(3) sin(---------) = 0
- 4 4
-@end group
-@group
-(%i14) eq2:part(L,3)=0;
- 8 x - %pi
-(%o14) sin(---------) = 0
- 4
-@end group
-(%i15) S1:trigsolve(eq1,0,2*%pi);
- %pi 13 %pi
-(%o15) @{---, ------@}
- 12 12
-(%i16) S2:trigsolve(eq2,0,2*%pi);
- %pi 5 %pi 9 %pi 13 %pi
-(%o16) @{---, -----, -----, ------@}
- 8 8 8 8
-(%i17) S:listify(union(S1,S2));
- %pi %pi 5 %pi 13 %pi 9 %pi 13 %pi
-(%o17) [---, ---, -----, ------, -----, ------]
- 12 8 8 12 8 8
-(%i18) float(%), numer;
-(%o18) [0.2617993877991494, 0.3926990816987241, 1.963495408493621,
- 3.403392041388942, 3.534291735288517, 5.105088062083414]
+(%i6) eq2:part(L,3)=0;
+ 8 x - %pi
+(%o6) sin(---------) = 0
+ 4
+@end group
+@group
+(%i7) S1:trigsolve(eq1,0,2*%pi);
+ %pi 13 %pi
+(%o7) @{---, ------@}
+ 12 12
+@end group
+@group
+(%i8) S2:trigsolve(eq2,0,2*%pi);
+ %pi 5 %pi 9 %pi 13 %pi
+(%o8) @{---, -----, -----, ------@}
+ 8 8 8 8
+@end group
+@group
+(%i9) S:listify(union(S1,S2));
+ %pi %pi 5 %pi 13 %pi 9 %pi 13 %pi
+(%o9) [---, ---, -----, ------, -----, ------]
+ 12 8 8 12 8 8
+@end group
+@group
+(%i10) float(%), numer;
+(%o10) [0.2617993877991494, 0.39269908169872414,
+1.9634954084936207, 3.4033920413889422, 3.5342917352885173,
+5.105088062083414]
+@end group
@end example
Answer:
commit 75f7ba5205921ccf11d6dce83148934b69f8b4e3
Author: Raymond Toy <toy...@gm...>
Date: Thu Sep 4 15:29:42 2025 -0700
Add new comment blocks for examples and regenerate them
There are still many left to do.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index 949e818a0..cb46c63d4 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -69,40 +69,58 @@ m4_mathdot(<<<r\cos(x-\phi)>>>, <<<@math{r*cos(x-phi)}>>>)
@code{load("trigtools")} loads these functions.
Examples:
-@example
+@c ===beg===
+@c load("trigtools")$
+@c c2sin(3*sin(x)+4*cos(x));
+@c trigexpand(%),expand;
+@c c2cos(3*sin(x)-4*cos(x));
+@c trigexpand(%),expand;
+@c c2sin(sin(x)+cos(x));
+@c trigexpand(%),expand;
+@c c2cos(sin(x)+cos(x));
+@c trigexpand(%),expand;
+@c ===end===
+@example maxima
(%i1) load("trigtools")$
+@group
(%i2) c2sin(3*sin(x)+4*cos(x));
- 4
-(%o2) 5 sin(x + atan(-))
- 3
+ 4
+(%o2) 5 sin(x + atan(-))
+ 3
+@end group
+@group
(%i3) trigexpand(%),expand;
-(%o3) 3 sin(x) + 4 cos(x)
-
+(%o3) 3 sin(x) + 4 cos(x)
+@end group
@group
(%i4) c2cos(3*sin(x)-4*cos(x));
- 3
-(%o4) - 5 cos(x + atan(-))
- 4
+ 3
+(%o4) - 5 cos(x + atan(-))
+ 4
@end group
@group
(%i5) trigexpand(%),expand;
-(%o5) 3 sin(x) - 4 cos(x)
+(%o5) 3 sin(x) - 4 cos(x)
@end group
@group
(%i6) c2sin(sin(x)+cos(x));
- %pi
-(%o6) sqrt(2) sin(x + ---)
- 4
+ %pi
+(%o6) sqrt(2) sin(x + ---)
+ 4
@end group
+@group
(%i7) trigexpand(%),expand;
-(%o7) sin(x) + cos(x)
+(%o7) sin(x) + cos(x)
+@end group
+@group
(%i8) c2cos(sin(x)+cos(x));
- %pi
-(%o8) sqrt(2) cos(x - ---)
- 4
+ %pi
+(%o8) sqrt(2) cos(x - ---)
+ 4
+@end group
@group
(%i9) trigexpand(%),expand;
-(%o9) sin(x) + cos(x)
+(%o9) sin(x) + cos(x)
@end group
@end example
@@ -176,26 +194,54 @@ Examples:
@enumerate
@item @w{ }
-@example
+@c ===beg===
+@c load(trigtools)$
+@c sinh(x)=c2trig(sinh(x));
+@c cosh(x)=c2trig(cosh(x));
+@c tanh(x)=c2trig(tanh(x));
+@c coth(x)=c2trig(coth(x));
+@c ===end===
+@example maxima
(%i1) load(trigtools)$
+@group
(%i2) sinh(x)=c2trig(sinh(x));
-cosh(x)=c2trig(cosh(x));
-tanh(x)=c2trig(tanh(x));
-coth(x)=c2trig(coth(x));
-(%o2) sinh(x) = - %i sin(%i x)
-(%o3) cosh(x) = cos(%i x)
-(%o4) tanh(x) = - %i tan(%i x)
-(%o5) coth(x) = %i cot(%i x)
+(%o2) sinh(x) = - %i sin(%i x)
+@end group
+@group
+(%i3) cosh(x)=c2trig(cosh(x));
+(%o3) cosh(x) = cos(%i x)
+@end group
+@group
+(%i4) tanh(x)=c2trig(tanh(x));
+(%o4) tanh(x) = - %i tan(%i x)
+@end group
+@group
+(%i5) coth(x)=c2trig(coth(x));
+(%o5) coth(x) = %i cot(%i x)
+@end group
@end example
@item see @url{https://maxima.sourceforge.io/ext/list_archives/2013/msg03230.html}
-@example
-(%i6) cos(p+q*%i);
-(%o6) cos(%i q + p)
-(%i7) trigexpand(%);
-(%o7) cos(p) cosh(q) - %i sin(p) sinh(q)
-(%i8) c2trig(%);
-(%o8) cos(%i q + p)
+@c ===beg===
+@c load("trigtools")$
+@c cos(p+q*%i);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cos(p+q*%i);
+(%o2) cos(%i q + p)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3) cos(p) cosh(q) - %i sin(p) sinh(q)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4) cos(%i q + p)
+@end group
@end example
@item @w{ }
@@ -209,42 +255,77 @@ coth(x)=c2trig(coth(x));
@end example
@item @w{ }
-@example
-(%i12) cos(a*%i+b*%i);
-(%o12) cos(%i b + %i a)
-(%i13) trigexpand(%);
-(%o13) sinh(a) sinh(b) + cosh(a) cosh(b)
-(%i14) c2trig(%);
-(%o14) cos(%i b + %i a)
+@c ===beg===
+@c load("trigtools")$
+@c cos(a*%i+b*%i);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cos(a*%i+b*%i);
+(%o2) cos(%i b + %i a)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3) sinh(a) sinh(b) + cosh(a) cosh(b)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4) cos(%i b + %i a)
+@end group
@end example
@item @w{ }
-@example
-(%i15) tan(a+%i*b);
-(%o15) tan(%i b + a)
+@c ===beg===
+@c load("trigtools")$
+@c tan(a+%i*b);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) tan(a+%i*b);
+(%o2) tan(%i b + a)
+@end group
@group
-(%i16) trigexpand(%);
- %i tanh(b) + tan(a)
-(%o16) ---------------------
- 1 - %i tan(a) tanh(b)
+(%i3) trigexpand(%);
+ %i tanh(b) + tan(a)
+(%o3) ---------------------
+ 1 - %i tan(a) tanh(b)
@end group
@group
-(%i17) c2trig(%);
-(%o217) tan(%i b + a)
+(%i4) c2trig(%);
+(%o4) tan(%i b + a)
@end group
@end example
@item @w{ }
-@example
-(%i18) cot(x+%i*y);
-(%o18) cot(%i y + x)
-(%i19) trigexpand(%);
- (- %i cot(x) coth(y)) - 1
-(%o19) -------------------------
- cot(x) - %i coth(y)
-(%i20) c2trig(%);
-(%o20) cot(%i y + x)
+@c ===beg===
+@c load("trigtools")$
+@c cot(x+%i*y);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cot(x+%i*y);
+(%o2) cot(%i y + x)
+@end group
+@group
+(%i3) trigexpand(%);
+ - %i cot(x) coth(y) - 1
+(%o3) -----------------------
+ cot(x) - %i coth(y)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4) cot(%i y + x)
+@end group
@end example
@end enumerate
@@ -267,16 +348,29 @@ to expression with hyperbolic functions sinh, cosh.
Examples:
-@example
-(%i6) c2hyp(exp(x));
-(%o6) sinh(x) + cosh(x)
-(%i7) c2hyp(exp(x)+exp(x^2)+1);
- 2 2
-(%o7) sinh(x ) + cosh(x ) + sinh(x) + cosh(x) + 1
-(%i8) c2hyp(exp(x)/(2*exp(y)-3*exp(z)));
- sinh(x) + cosh(x)
-(%o8) ---------------------------------------------
- 2 (sinh(y) + cosh(y)) - 3 (sinh(z) + cosh(z))
+@c ===beg===
+@c load("trigtools")$
+@c c2hyp(exp(x));
+@c c2hyp(exp(x)+exp(x^2)+1);
+@c c2hyp(exp(x)/(2*exp(y)-3*exp(z)));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) c2hyp(exp(x));
+(%o2) sinh(x) + cosh(x)
+@end group
+@group
+(%i3) c2hyp(exp(x)+exp(x^2)+1);
+ 2 2
+(%o3) sinh(x ) + cosh(x ) + sinh(x) + cosh(x) + 1
+@end group
+@group
+(%i4) c2hyp(exp(x)/(2*exp(y)-3*exp(z)));
+ sinh(x) + cosh(x)
+(%o4) ---------------------------------------------
+ 2 (sinh(y) + cosh(y)) - 3 (sinh(z) + cosh(z))
+@end group
@end example
@opencatbox{Categories:}
@@ -301,13 +395,23 @@ Examples:
@enumerate
@item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(x)+cos(x));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
(%i2) trigfactor(sin(x)+cos(x));
- %pi
-(%o2) sqrt(2) cos(x - ---)
- 4
+ %pi
+(%o2) sqrt(2) cos(x - ---)
+ 4
+@end group
+@group
(%i3) trigrat(%);
-(%o3) sin(x) + cos(x)
+(%o3) sin(x) + cos(x)
+@end group
@end example
@item @w{ }
@@ -325,35 +429,66 @@ Examples:
@end example
@item @w{ }
-@example
-(%i6) trigfactor(sin(x)-cos(3*y));
- 3 y x %pi 3 y x %pi
-(%o6) 2 sin(--- - - + ---) sin(--- + - - ---)
- 2 2 4 2 2 4
-(%i7) trigrat(%);
-(%o7) sin(x) - cos(3 y)
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(x)-cos(3*y));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) trigfactor(sin(x)-cos(3*y));
+ 3 y x %pi 3 y x %pi
+(%o2) 2 sin(--- - - + ---) sin(--- + - - ---)
+ 2 2 4 2 2 4
+@end group
+@group
+(%i3) trigrat(%);
+(%o3) sin(x) - cos(3 y)
+@end group
@end example
@item @w{ }
-@example
-(%i8) trigfactor(-sin(5*x)-cos(3*y));
- 3 y 5 x %pi 3 y 5 x %pi
-(%o8) - 2 cos(--- - --- + ---) cos(--- + --- - ---)
- 2 2 4 2 2 4
-(%i9) trigrat(%);
-(%o9) (- cos(3 y)) - sin(5 x)
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(-sin(5*x)-cos(3*y));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) trigfactor(-sin(5*x)-cos(3*y));
+ 3 y 5 x %pi 3 y 5 x %pi
+(%o2) - 2 cos(--- - --- + ---) cos(--- + --- - ---)
+ 2 2 4 2 2 4
+@end group
+@group
+(%i3) trigrat(%);
+(%o3) - cos(3 y) - sin(5 x)
+@end group
@end example
@item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c sin(alpha)+sin(beta)=trigfactor(sin(alpha)+sin(beta));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
@group
-(%i10) sin(alpha)+sin(beta)=trigfactor(sin(alpha)+sin(beta));
- beta alpha beta alpha
-(%o10) sin(beta) + sin(alpha) = 2 cos(---- - -----) sin(---- + -----)
- 2 2 2 2
+(%i2) sin(alpha)+sin(beta)=trigfactor(sin(alpha)+sin(beta));
+ beta alpha
+(%o2) sin(beta) + sin(alpha) = 2 cos(---- - -----)
+ 2 2
+ beta alpha
+ sin(---- + -----)
+ 2 2
+@end group
+@group
+(%i3) trigrat(%);
+(%o3) sin(beta) + sin(alpha) = sin(beta) + sin(alpha)
@end group
-(%i11) trigrat(%);
-(%o78) sin(beta) + sin(alpha) = sin(beta) + sin(alpha)
@end example
@item @w{ }
@@ -365,45 +500,82 @@ Examples:
@end example
@item @w{ }
-@example
-(%i13) cos(alpha)+cos(beta)=trigfactor(cos(alpha)+cos(beta));
- beta alpha beta alpha
-(%o80) cos(beta) + cos(alpha) = 2 cos(---- - -----) cos(---- + -----)
- 2 2 2 2
+@c ===beg===
+@c load("trigtools")$
+@c cos(alpha)+cos(beta)=trigfactor(cos(alpha)+cos(beta));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cos(alpha)+cos(beta)=trigfactor(cos(alpha)+cos(beta));
+ beta alpha
+(%o2) cos(beta) + cos(alpha) = 2 cos(---- - -----)
+ 2 2
+ beta alpha
+ cos(---- + -----)
+ 2 2
+@end group
@end example
@item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c cos(alpha)-cos(beta)=trigfactor(cos(alpha)-cos(beta));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
@group
-(%i14) cos(alpha)-cos(beta)=trigfactor(cos(alpha)-cos(beta));
- beta alpha beta alpha
-(%o14) cos(alpha) - cos(beta) = 2 sin(---- - -----) sin(---- + -----)
- 2 2 2 2
+(%i2) cos(alpha)-cos(beta)=trigfactor(cos(alpha)-cos(beta));
+ beta alpha
+(%o2) cos(alpha) - cos(beta) = 2 sin(---- - -----)
+ 2 2
+ beta alpha
+ sin(---- + -----)
+ 2 2
@end group
@end example
@item @w{ }
-@example
-(%i15) trigfactor(3*sin(x)+7*cos(x));
-(%o15) 3 sin(x) + 7 cos(x)
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(3*sin(x)+7*cos(x));
+@c c2sin(%);
+@c trigexpand(%),expand;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
@group
-(%i16) c2sin(%);
- 7
-(%o16) sqrt(58) sin(x + atan(-))
- 3
+(%i2) trigfactor(3*sin(x)+7*cos(x));
+(%o2) 3 sin(x) + 7 cos(x)
@end group
@group
-(%i17) trigexpand(%),expand;
-(%o17) 3 sin(x) + 7 cos(x)
+(%i3) c2sin(%);
+ 7
+(%o3) sqrt(58) sin(x + atan(-))
+ 3
+@end group
+@group
+(%i4) trigexpand(%),expand;
+(%o4) 3 sin(x) + 7 cos(x)
@end group
@end example
-10.
-@example
-(%i18) trigfactor(sin(2*x));
-(%o18) sin(2 x)
-(%i19) trigexpand(%);
-(%o19) 2 cos(x) sin(x)
+@item @w{ }
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(2*x));
+@c trigexpand(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) trigfactor(sin(2*x));
+(%o2) sin(2 x)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3) 2 cos(x) sin(x)
+@end group
@end example
@end enumerate
-----------------------------------------------------------------------
hooks/post-receive
--
Maxima CAS
|