ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{
Table[
TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}],
(* do not integrate this *)
Table[
TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}]},
(* integrate this *)
Frame -> All, ItemStyle -> Directive[FontSize -> 18, Bold]]
(there will be much more examples ex3,ex4, etc.)
This works nice, but I need to tell Mathematica not to Integrate in the first
row of the table - examples (only in the second one - results). Is there any
possibility to suppress the evaluation of the Integral in the first row of
the grid and just print the symbol of Integral and the TraditionalForm of the
example behind it?
May be this is a newbie kind of question, but I have spent lot of time on it,
and I cannot solve it.
Thanks in advance for any help
Jakub
Grid[
{(* Do not integrate the first row *)
Table[HoldForm[Integrate[integrand, x]] /.
integrand -> expr, {expr, {ex1, ex2}}],
(* Integrate the second row *)
Table[Integrate[expr, x], {expr, {ex1, ex2}}]}, Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]] // TraditionalForm
With the Presentations package it is possible to use the command HoldOp,
which holds an operation but evaluates the arguments. Then we could write
the above more simply as:
Needs["Presentations`Master`"]
Grid[
{(* Do not integrate this *)
Table[Integrate[expr, x] //
HoldOp[Integrate], {expr, {ex1, ex2}}],
(* Integrate this *)
Table[Integrate[expr, x], {expr, {ex1, ex2}}]}, Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]] // TraditionalForm
Or if you use the Student's Integral part of Presentations you can write it
even simpler using Integrate with a small 'i'.
Grid[
{(* Do not integrate this *)
Table[integrate[expr, x], {expr, {ex1, ex2}}],
(* Integrate this *)
Table[Integrate[expr, x], {expr, {ex1, ex2}}]},
Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]] // TraditionalForm
And if you want the students to actually practice doing integrals
step-by-step using basic integration techniques and a BasicIntegralTable,
such as students often work from, then the first integral could be done by
the following commands:
integrate[ex1, x] // TraditionalForm
% // OperateIntegrand[Apart] // TraditionalForm
% // BreakoutIntegral // TraditionalForm
% // UseIntegralTable[BasicIntegralTable] // TraditionalForm
There are also commands: ChangeIntegralVariable, IntegrateByParts and
Trigonometric Substitute. You can also do definite integrals and obtain
intermediate limit bracket expressions. A student can bypass the Mathematica
Integrate command altogether using integral tables, or at some point the
student can hand the integral over to Mathematica's Integrate or NIntegrate
command.
--
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/
"Serych Jakub" <Ser...@panska.cz> wrote in message
news:gci1sm$iv$1...@smc.vnet.net...
This is what I would do:
ex[1] = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex[2] = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
heldintegrate[expr_, x_] :=
With[{e = expr}, HoldForm[Integrate[e, x]]]
Grid[{Table[TraditionalForm[
heldintegrate[ex[nr], x]
], {nr, 1, 2}],(*do not integrate this*)
Table[TraditionalForm[Integrate[ex[nr], x]], {nr, 1,
2}]},(*integrate this*)Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]]
hth,
albert
Jakub,
One way is to just leave off the Integrate[], and prepend an Integral
sign to the "TraditionalForm" string, ie
ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{Table[
"\[Integral]"
TraditionalForm[Symbol["ex" <> ToString[nr]], x], {nr, 1,
2}],(*do not integrate this*)
Table[TraditionalForm[
Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1,
2}]},(*integrate this*)Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]]
-Bob Freeman
> I want to write notebook which prints simple integration examples with
> results for the students.
> Something like:
>
> ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
> ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
>
> Grid[{
> Table[
> TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}],
> (* do not integrate this *)
> Table[
> TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}]},
> (* integrate this *)
> Frame -> All, ItemStyle -> Directive[FontSize -> 18, Bold]]
>
> (there will be much more examples ex3,ex4, etc.)
>
> This works nice, but I need to tell Mathematica not to Integrate in the first
> row of the table - examples (only in the second one - results). Is there any
> possibility to suppress the evaluation of the Integral in the first row of
> the grid and just print the symbol of Integral and the TraditionalForm of the
> example behind it?
One possible way is illustrated below. First, we prevent the evaluation
of the integrals (but not of the inner expression leading to the
integrands) by substituting a dummy symbol, say 'int', in place of
*Integrate*, then we replace the dummy head by
*HoldForm[Integrate[__]]*, and voila!
ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{Table[
TraditionalForm[
int[Symbol["ex" <> ToString[nr]], x] /.
int[exp__] -> HoldForm[Integrate[exp]]], {nr, 1,
2}],(*do not integrate this*)
Table[TraditionalForm[
Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1,
2}]},(*integrate this*)Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]]
Regards,
-- Jean-Marc
ex[1] = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex[2] = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{Table[
TraditionalForm[
With[{exx = ex[nr]}, HoldForm[Integrate[exx, x]]]], {nr, 1,
2}],(*do not integrate this*)
Table[TraditionalForm[
Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1,
2}]},(*integrate this*)Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]]
Notice that the 'With' construct injects the value of ex[nr] inside the
HoldForm construction, but the HoldForm still prevents further
evaluation - which is exactly what you want.
David Bailey
http://www.dbaileyconsultancy.co.uk
Hello Jakub,
The keyword is HoldForm:
Grid[
{HoldForm[Integrate[#, x]], Integrate[#, x]} & /@ {ex1, ex2},
Frame -> All, ItemStyle -> Directive[FontSize -> 18, Bold]
] // TraditionalForm
(You might want to Transpose the list inside the grid.)
ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
toHoldForm[expr_] := (HoldForm @@ {expr}) /. int -> Integrate
Grid[{Table[
toHoldForm[
TraditionalForm[int[Symbol["ex" <> ToString[nr]], x]]], {nr, 1,
2}],(*do not integrate this*)
Table[TraditionalForm[
Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1,
2}]},(*integrate this*)Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]]
??
Regards
Jens
input = {
(1 - 3*x^3 + 2*x^5)/(4*x^3),
(-5*x^(1/4) + (x^2)^(4/3))/x^(3/2),
Sin[x], Cos[x]
};
labels = HoldForm[Integrate[#, x]] & /@ input;
output = ReleaseHold[labels] // FullSimplify;
Grid[Transpose[{labels, output}],
Frame -> All,
ItemStyle -> Directive[18, Bold]] // TraditionalForm
Bob Hanlon
---- Serych Jakub <Ser...@panska.cz> wrote:
=============
I want to write notebook which prints simple integration examples with
results for the students.
Something like:
ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{
Table[
TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}],
(* do not integrate this *)
Table[
TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}]},
(* integrate this *)
Frame -> All, ItemStyle -> Directive[FontSize -> 18, Bold]]
(there will be much more examples ex3,ex4, etc.)
This works nice, but I need to tell Mathematica not to Integrate in the first
row of the table - examples (only in the second one - results). Is there any
possibility to suppress the evaluation of the Integral in the first row of
the grid and just print the symbol of Integral and the TraditionalForm of the
example behind it?
May be this is a newbie kind of question, but I have spent lot of time on it,
and I cannot solve it.
Thanks in advance for any help
Jakub
--
Bob Hanlon
Thanks folks, for a really helpful thread. Very instructive.
ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{(*Do not integrate this*)
Table[Row[{"\[Integral]", expr , "dx"}], {expr, {ex1,
ex2}}],(*Integrate this*)
Table[Integrate[expr, x], {expr, {ex1, ex2}}]}, Frame -> All,
ItemStyle -> Directive[FontSize -> 18, Bold]] // TraditionalForm
Best, Alexei
I want to write notebook which prints simple integration examples with
results for the students.
Something like:
ex1 = (1 - 3*x^3 + 2*x^5)/(4*x^3);
ex2 = (-5*x^(1/4) + (x^2)^(4/3))/x^(3/2);
Grid[{
Table[
TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}],
(* do not integrate this *)
Table[
TraditionalForm[Integrate[Symbol["ex" <> ToString[nr]], x]], {nr, 1, 2}]},
(* integrate this *)
Frame -> All, ItemStyle -> Directive[FontSize -> 18, Bold]]
(there will be much more examples ex3,ex4, etc.)
This works nice, but I need to tell Mathematica not to Integrate in the first
row of the table - examples (only in the second one - results). Is there any
possibility to suppress the evaluation of the Integral in the first row of
the grid and just print the symbol of Integral and the TraditionalForm of the
example behind it?
May be this is a newbie kind of question, but I have spent lot of time on it,
and I cannot solve it.
Thanks in advance for any help
Jakub
--
Alexei Boulbitch, Dr., Habil.
Senior Scientist
IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg
Phone: +352 2454 2566
Fax: +352 2454 3566
Website: www.iee.lu
This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.