acer

32597 Reputation

29 Badges

20 years, 41 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

I'm not sure how exacty you want it to look. But here's a start.

insert_pictures_ac.mw

Below I first inline and attach a worksheet that does this in a very simple way.

Then at the end I attach another worksheet whose Startup Code contains a rough version of a package that provides some more automatic support for such things (eg. some Units support, convert/combine/evalc/Re/Im/etc, and a few context-menu items). Sorry, it's got an accidental quirk in its static evalf export that makes it a bit awkward to work with float values -- I ought to fix that.

Sorry that the 2D Math parser is so picky about brackets around floats and negative values for the infix `∠` operator. You can find that on the "Operators" palette, by the way (and you can add it to your Favorites palette). There's a bit of GUI weirdness around.

This first approach below doesn't need any add-on. [edit] Carl Love did something similar once, if I recall, but I cannot find that post at the moment.

restart

I want to calculate the voltage between phase 1 and phase N in an electrical circuit:``

 

The vectorial formula is:

`#mover(mi("U"),mo("→"))`[L1-N]-`#mover(mi("ΔU",mathcolor = "blue"),mo("→",mathcolor = "blue"))`[L1]+`#mover(mi("ΔU",mathcolor = "#339966"),mo("→",mathcolor = "#339966"))`[N] = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

`#mover(mi("U"),mo("→"))`[L1-N]-`#mover(mi("ΔU",mathcolor = "blue"),mo("→",mathcolor = "blue"))`[L1]+`#mover(mi("ΔU",mathcolor = "#339966"),mo("→",mathcolor = "#339966"))`[N] = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

 

Voltage drops are calculated with the current multiplied with the resistance: ΔU = I*Z[L]

I*Z[L]

 

i

 

-`#mover(mi("I",mathcolor = "blue"),mo("→",mathcolor = "blue"))`[L1]*`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L]+`#mover(mi("I",mathcolor = "#339966"),mo("→",mathcolor = "#339966"))`[N]*`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L]+`#mover(mi("U"),mo("→"))`[L1-N] = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]``

-`#mover(mi("I",mathcolor = "blue"),mo("→",mathcolor = "blue"))`[L1]*`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L]+`#mover(mi("I",mathcolor = "#339966"),mo("→",mathcolor = "#339966"))`[N]*`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L]+`#mover(mi("U"),mo("→"))`[L1-N] = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

This is a real example with realistic values and angles:

`∠` := proc (a, b) polar(a, (1/180)*b*Pi) end proc; ex := proc (v) abs(v), 180*argument(v)/Pi end proc

`#mover(mi("U"),mo("→"))`[L1-N] := `∠`(230.0, 0)

polar(230.0, 0)

`#mover(mi("I",mathcolor = "blue"),mo("→",mathcolor = "blue"))`[L1] := `∠`(20.0, -30)

polar(20.0, -(1/6)*Pi)

`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L] := `∠`(0.97e-1, 7.2)

polar(0.97e-1, .1256637062)

`#mover(mi("I",mathcolor = "#339966"),mo("→",mathcolor = "#339966"))`[N] := `∠`(40.0, -120)

polar(40.0, -(2/3)*Pi)

 

The negative angles is because i am using my reference which is in 0°. And are the vector to the right of my reference is the angle negative, and is it on the left of my reference is the angle negative. I dont want to explain the vectorial diagram, because i think it will do more confusion than explaining.

 

NULL

ex(simplify(`∠`(230, 0)-`∠`(20, -30)*`∠`(0.97e-1, 7.2)+`∠`(40, -120)*`∠`(0.97e-1, 7.2))) = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

(226.7256260, -.7139358882) = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

My question is, if the formula above is possible to solve in maple?

ex(simplify(-`#mover(mi("I",mathcolor = "blue"),mo("→",mathcolor = "blue"))`[L1]*`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L]+`#mover(mi("I",mathcolor = "#339966"),mo("→",mathcolor = "#339966"))`[N]*`#mover(mi("Z",mathcolor = "#ff99cc"),mo("→",mathcolor = "#ff99cc"))`[L]+`#mover(mi("U"),mo("→"))`[L1-N])) = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

(226.7256260, -.7139358882) = `#mover(mi("U",mathcolor = "red"),mo("→",mathcolor = "red"))`[L1-N]

``

Download Example_to_Mapleprimes_ac2.mw

And here's the other worksheet I mentioned, using a rough prototype of my "Phasors" package in the Startup Code region. [edit] To utilize this in another worksheet you'd have to copy the Startup Code, since I have not yet made it into a downloadable package from the Maple cloud.

Example_to_Mapleprimes_ac.mw

note: "Phasor" may not be the best term here. "degree-polar" might be better. Are the multiplications in your calculation meant to represent something like a phasor multiplied by a complex value? Or phasor-phasor product?
note: What was the precise result from your calculator?

Your expectation indicates that you have not read and understood the relevant part of the interface help page.

Regarding the errorbreak setting, the help page for topic interface says, "Controls Maple's behavior when an error occurs while reading Maple commands from a file or redirected standard input, as follows:..."

That description does not state that it controls the general flow of an executing worksheet.

Inside the GUI, the setting of interface(errorbreak) affects the behavior during execution of the read command. It controls the error severity level that will stop further reading of the plaintext file's Maple statements.

Let us know if you really need the appearance of the addends to be of the form wf δ θf (...)  etc.  That could be done as a visual effect, since normally some of those terms would automatically simplify (eg. wf*delta*wf automatically simplifies to delta*wf^2). The other terms could be managed using special invocation of the `sort` command. But the squares are trickier.

The addends in ans1 below are mathematically as you asked, if I understand correctly. The precise formatting is also possible -- but it'd be just that, a pretty-printing affect.

restart

c := -(lambda*`θf`+lambda*`θi`+2*wf-2*wi)/lambda^3

d := (lambda*`θf`+2*lambda*`θi`+3*wf-3*wi)/lambda^2:

g := 6*c*x+2*d:

h := delta*g:

expr := expand(g*h)

4*delta*`θf`^2/lambda^2+16*delta*`θi`^2/lambda^2+36*delta*wi^2/lambda^4+36*delta*wf^2/lambda^4+72*delta*x^2*`θf`*`θi`/lambda^4+144*delta*x^2*`θf`*wf/lambda^5-144*delta*x^2*`θf`*wi/lambda^5-72*delta*x*`θf`*`θi`/lambda^3-120*delta*x*`θf`*wf/lambda^4+120*delta*x*`θf`*wi/lambda^4+144*delta*x^2*`θi`*wf/lambda^5-144*delta*x^2*`θi`*wi/lambda^5-168*delta*x*`θi`*wf/lambda^4+168*delta*x*`θi`*wi/lambda^4-288*delta*x^2*wf*wi/lambda^6+288*delta*x*wf*wi/lambda^5+36*delta*x^2*`θf`^2/lambda^4+144*delta*x^2*wi^2/lambda^6+24*delta*`θf`*wf/lambda^3-72*delta*wf*wi/lambda^4-144*delta*x*wi^2/lambda^5+16*delta*`θf`*`θi`/lambda^2-24*delta*x*`θf`^2/lambda^3-48*delta*x*`θi`^2/lambda^3+144*delta*x^2*wf^2/lambda^6+48*delta*`θi`*wf/lambda^3-48*delta*`θi`*wi/lambda^3+36*delta*x^2*`θi`^2/lambda^4-144*delta*x*wf^2/lambda^5-24*delta*`θf`*wi/lambda^3

L := [wi, wf, `θf`, `θi`];

[wi, wf, `θf`, `θi`]

CC := map(proc (p) options operator, arrow; delta*(`*`(op(p))) end proc, C):

ee := expand(expr):

ans1 := thaw(collect(ee, map(rhs, CCC), simplify));

36*delta*wi^2*(lambda^2-4*lambda*x+4*x^2)/lambda^6-72*(lambda^2-4*lambda*x+4*x^2)*delta*wf*wi/lambda^6-24*(lambda^2-5*lambda*x+6*x^2)*delta*`θf`*wi/lambda^5-24*`θi`*(2*lambda^2-7*lambda*x+6*x^2)*wi*delta/lambda^5+36*(lambda^2-4*lambda*x+4*x^2)*wf^2*delta/lambda^6+24*(lambda^2-5*lambda*x+6*x^2)*delta*`θf`*wf/lambda^5+24*`θi`*(2*lambda^2-7*lambda*x+6*x^2)*wf*delta/lambda^5+4*(lambda^2-6*lambda*x+9*x^2)*`θf`^2*delta/lambda^4+8*`θi`*(2*lambda^2-9*lambda*x+9*x^2)*`θf`*delta/lambda^4+4*(4*lambda^2-12*lambda*x+9*x^2)*`θi`^2*delta/lambda^4

simplify(expr-ans1);

0

``

Download Final_objective_orig_ac.mw

 

This has been asked several times in the past. There are at least half a dozen different ways to approach implementing it.

See responses to these old Questions:  here, here, and here, (or this zany answer).

There are also variations on some of those (ie. the first cited link's Answers) where the InertForms package or manually constructed Typeset 2D Math can display the chain of intermediary and final results in a single output line. This can help get rid of some extraneous brackets in the final display. Personally, I find InertForms to be somewhat clunky -- but I don't recall revisiting the whole question and generating a variant that constructs the Typeset 2D Math behind the scenes.

It could help if you gave us the hardest example that you expect to handle, and describe exactly how you want it to appear. There are too many ways to code it up so that your toy example looks fine but more involved examples (eg. more intermediate steps, things other than simple arithmetic, etc) don't look best. 

Do you need the operators (+, *, etc) to display as usual, or would a lighter gray shade be ok?

In the case of a deeper level of assignment do you want to see each level displayed or just the final numeric values before evaluation? For example, x:=y; y:=z; z:=4.0; and then would input sin(x) show just the additional unevaluated sin(4.0) = -0.757...?

Also important is whether you expect the return-value to be as usual (just the last item in your chain). Is it ok to have the usual return-value, whose usual echoing is suppressed by you (ending your statement with a colon), and your desired chain be merely printed as side-effect? Or can/should the return-value be something that echoes like your displayed chain?

I understand that some of these subtleties may seem hard to grasp, as a beginner. That's why I showed the variety of those cited responses.

Here's an example, necessarily simple because you haven't yet provided a clear description of the data and goal.

restart;

N:=20:

P1:=[seq(plot([[N-i,N-i]],style=point,symbolsize=30,symbol=solidcircle,
              color=gold,transparency=1-evalf(i/N)),i=1..N)]:

P2:=plot([seq([N-i,N-i],i=1..N)],style=point,symbolsize=30,symbol=solidcircle,
         colorscheme=["xgradient",[gold,white]]):

 

If you don't intend on overlaying the points on any other plot artefact (ie. just a white background), then it's simpler to adjust the coloring than to deal with separate transparency for each point.

 

In that case, if you want the fade to be either vertically or horizontally applied, then it's easier still to simply use the colorscheme option.

 

Computing the transparency value from a precomputed set of points is also possible, but brings the extra burden of mapping the range of the point values into the range 0..1. If that's your situation, and if you really do need that variant, then let us know.

 

plots:-display(P1[]);
P2;

 

A visual distinction appears, of course, if you overlay the points on some other plot artefact (a shaded polygon, or a background).

 

But so far it's unclear whether you need this.

 

P1all:=plots:-display(P1[],
                      plottools:-polygon([[0,0],[10,0],[10,10],[0,10]],color=blue),
                      plottools:-polygon([[10,10],[20,10],[20,20],[10,20]],color=red));

P2all:=plots:-display(P2,
                      plottools:-polygon([[0,0],[10,0],[10,10],[0,10]],color=blue),
                      plottools:-polygon([[10,10],[20,10],[20,20],[10,20]],color=red));

 

Download point_transparency.mw

You are using the wrong command.

StringTools:-Has is for testing for the presence of a single character. Read its help page. That pages states, "Furthermore, if the length of ch is greater than 1, then characters in ch after the first are ignored." So your calls to StringTools:-Has are merely testing for the presence of "_".

You could instead try testing whether StringTools:-Search succeeds, ie. returns a nonzero result.

@Christian Wolinski That's an error message coming out of Maple's Java GUI, rather than the Maple kernel. It means that you've tried to display/print an invalid plotting structure.

What makes you think that RGBA is a valid colorspace specification for the COLOR substructure of a plotting structure? It is not. The valid values are RGB, HSV, and HUE. That is documented on the Maple help page with topic plot,structure

Why don't you answer the question about how the problematic plotting structure was created? Did you construct it directly, rather than obtaining it from some Library plotting command?

I suspect that you are trying to utilize a fourth alpha color channel within a constructed plot structure (related to this recent Question), but that is not supported by the COLOR/COLOUR plotting substructure.

The message is displayed when the GUI tries to print the invalid structure. Depending on what else is in the whole structure some partial plot may be rendered. For example,

restart;

p1:=PLOT(POINTS([2,3],COLOR(RGB, 0, 0, 1))):

p2:=PLOT(POINTS([2,3],COLOR(RGBA, 0, 0, 1))):

p1;

p2;

com.maplesoft.mathdoc.model.plot.PlotException: Unrecognized option in COLOR: RGBA

 

Download RGBA_error.mw

The commandline interface emits a slightly different message, eg, Error, invalid COLOUR argument RGBA

 

The computations are not the same, and are done with different floating-point models by default.

By default the scalar-Vector multiplication is done using hardware double precision (since the scalar and Vector entries are of type numeric and the datatype of the Vector is 'anything'). The result is a datatype=float[8] Vector.

The same effect can be obtained for your second example, involving scalar-scalar multiplication, by casting both arguments to HFloat.

You can turn that off by setting the environment variable UseHardwareFloats to false.

Another way to prevent it is to use an input Vector whose datatype is not 'anything'. For example, it could be 'algebraic'. That's more effort to concoct, and doesn't allow for your pretty 2D Input form of the Vector. I hardly ever see this done.

restart

50/3.(Vector(2, {(1) = .72, (2) = 0.6e-1})); lprint(%)

Vector[column](2, {1 = HFloat(12.0000000024000002), 2 = HFloat(1.00000000020000002)}, datatype = float[8], storage = rectangular, order = Fortran_order, shape = [])

50/3*.72

12.00000000

50/3*0.6e-1

1.000000000

HFloat(0.72)*HFloat(50.*(1/3)); lprint(%)

HFloat(12.0000000024000002)

HFloat(0.06)*HFloat(50.*(1/3)); lprint(%)

HFloat(1.00000000020000002)

restart

UseHardwareFloats := false

50/3.(Vector(2, {(1) = .72, (2) = 0.6e-1})); lprint(%)

Vector[column](2, {1 = 12.00000000, 2 = 1.000000000}, datatype = sfloat, storage = rectangular, order = Fortran_order, shape = [])

50/3*.72

12.00000000

50/3*0.6e-1

1.000000000

HFloat(0.72)*HFloat(50.*(1/3)); lprint(%)

12.00000000

HFloat(0.06)*HFloat(50.*(1/3)); lprint(%)

1.000000000

restart

50/3.Vector(Vector(2, {(1) = .72, (2) = 0.6e-1}), datatype = algebraic); lprint(%)

Vector[column](2, {1 = 12.00000000, 2 = 1.000000000}, datatype = algebraic, storage = rectangular, order = Fortran_order, shape = [])

``

Download testLA_ac.mw

note: I removed your Numeric formatting of output. I'll add that forcing 20 digits of display for scalar results that return with only default Digits=10 decimal digits is like forcing an untruth, and somewhat obscures what's going on.

@mogi Does this do what you want, for your followup example?

[edit] I'm not sure that I understand your syntax. Couldn't you express it in words?

For a given value of d are you trying to use the maximal value that the expression takes for in a=0..1, or are you trying to use the value of a in 0..1 at which that maximum attains? Or are you trying to compute some else?

Here I use the value of a in 0..1 at which the maximum of the expression attains.

restart;

expr := exp(-d*a^2) - 1/3*d*(2*a^3 - 3*a^2 + 1):

#plot3d(expr,d=2..3,a=0..1);

obj := dd -> 1 - eval(a,Optimization:-Maximize(eval(expr,d=dd),a=0..1,
                                              method=branchandbound)[2]):

plot(obj, 0..10, size=[500,300]);

 

Download plot_max.mw

And here I use maximum value which the expression attains for a in 0..1.

restart;

expr := exp(-d*a^2) - 1/3*d*(2*a^3 - 3*a^2 + 1):

obj := dd -> 1 - Optimization:-Maximize(eval(expr,d=dd),a=0..1,
                                        method=branchandbound)[1]:

plot(obj, 0..10, size=[500,300]);

 

Download plot_max2.mw

Your code is not correct, which is why it gives an error message. You are mixing up the syntax for dealing with expressions versus operators. when invoking the plot command.

Either of these pairs of line work, following your preliminary code:
 

Et := delta -> E1(delta) + E2(delta); 
plot(Et(delta), delta = 16 .. 28);

 

Et := delta -> E1(delta) + E2(delta); 
plot(Et, 16 .. 28);

 

But your full original code calls plot with a first argument that evaluates to an operator, yet supplies the plotting domain in the form name=range which is suitable for the expression calling sequence. That's a mismatch.

note: It doesn't matter whether your original call was the 2D input of Et(delta) := delta -> E1(delta) + E2(delta) to create an operator (which, in turn, creates operators!) or to make a remember table assignment (of an operator!). In either case the accompanying call plot(Et(delta), delta = 16 .. 28) would then be invalid, because the first argument Et(delta) evaluates to an operator.

palmmp_ac.mw

You could even do it like so (in 2D as creating an operator which generates operators, or in either 1D or 2D as a remember table assignment of an operator). But it is error prone and dodgy, in my opinion, and will likely come back to bite you. I don't recommend it.

Et(delta) := delta -> E1(delta) + E2(delta); 
plot(Et(delta), 16 .. 28);

You cannot properly use d[1], d[2], and the unindexed name d in this way.

Your assignment to d[1] of an expression containing unindexed name d leads to an infinite recursion.

Rename d[1] and d[2] to something else, for example dd[1] and dd[2].

This is exactly the same kind of recursive assignment mistake that you previously made here (May 22, 2019), and the same fundamental misunderstanding that you made here (Jan 29, 2019) and here (Aug 19, 2017). The nature of the mistakes was clearly explained to you on each of those occasions.

note: Your call to value does nothing, similarly to how you misused it in your previous Question.

Below I am referring to version Maple 2016 (which is the version in which your attachment was last saved).

The behavior of Equations Labels inserted into 2D Input seems broken for the case of backslash characters in names.

It may also be problematic (in a different manner) in the case of such strings inserted as Equation Labels into 1D input.

So perhaps you could use assigned names instead of Equation Labels.

Personally, I prefer 1D Input, no Equation Labels, and nprintf and sprintf instead of convert if I know the type of my input.

  xmaple -standalone

Or, as I usually do it in a terminal,

  maple -x -standalone

IntTutor fails by default to find a complete solution for your example because it meets its step cutoff too soon, because noisy steps like Constant Multiple, etc, are taking up too much of its allotment.

By tagging the rules Constant, Constant Multiple, Sum, and Difference as Understood Rules then the tutor can find the completed solution for this given example, starting with the step to substitute x=sin(u) which it finds automatically.

If the path to a complete solution takes too many steps then the IntTutor will not find it, and it will return the steps that got farthest (even if those don't eventually help). This is what happens by default for your example.

Now, the steps are very verbose, by default. The Constant Multiple rule, for example, is something that I don't care to see applied explicitly (and certainly not when it is applied repeatedly for each term in an expanded sum of integrals!). And there are several other rules that I don't care to see being applied explicitly.

By suppressing visual statement of the application of a handful of noisy rules the IntTutor's total step count cutoff will generally come into play farther along into a problem. And for your particular problem this will allow a complete solution to be found.

In the following attachment the worksheet contains the returned result from IntTutor, after toggle those rules in the menu. And then, after restart, it does a similar thing using the programmatic commands.

restart;

kernelopts(version);

`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`

with(Student:-Calculus1):

# Within the Tutor I first toggle the Constant, Constant Multiple,
# Sum, and Difference rules from under the "Understood Rules" menu.
#
# That makes the solution short enough to be found.

IntTutor(x^2 * sqrt(1-x^2), x);

"[[∫x^2 sqrt(-x^2+1) ⅆx],[ ,"=",-(∫(sin(u))^4 ⅆu)+∫(sin(u))^2 ⅆu, [change,x=sin(u),u]],[ ,"=",-(∫(-1+cos(2 u))^2 ⅆu)/4+∫(sin(u))^2 ⅆu, [rewrite,(sin(u))^2=1/2-(cos(2 u))/2]],[ ,"=",-(∫(cos(2 u))^2 ⅆu)/4+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [rewrite,(-1+cos(2 u))^2=(cos(2 u))^2-2 cos(2 u)+1]],[ ,"=",-(∫(cos(u1))^2 ⅆu1)/8+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [change,u1=2 u,u1]],[ ,"=",-(∫cos(2 u1) ⅆu1)/16-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [rewrite,(cos(u1))^2=(cos(2 u1))/2+1/2]],[ ,"=",-(∫cos(u2) ⅆu2)/32-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [change,u2=2 u1,u2]],[ ,"=",-(sin(u2))/32-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [cos]],[ ,"=",-(sin(2 u1))/32-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(∫cos(2 u) ⅆu)/2+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(∫cos(u1) ⅆu1)/4+∫(sin(u))^2 ⅆu, [change,u1=2 u,u1]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(u1))/4+∫(sin(u))^2 ⅆu, [cos]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(2 u))/4+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫cos(2 u) ⅆu)/2, [rewrite,(sin(u))^2=1/2-(cos(2 u))/2]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫cos(u1) ⅆu1)/4, [change,u1=2 u,u1]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(sin(u1))/4, [cos]],[ ,"=",-(sin(4 u))/32+u/8, [revert]],[ ,"=",(sqrt(-x^2+1) x^3)/4-(x sqrt(-x^2+1))/8+(arcsin(x))/8, [revert]]]"

Int(x^2*(-x^2+1)^(1/2), x) = (1/4)*(-x^2+1)^(1/2)*x^3-(1/8)*x*(-x^2+1)^(1/2)+(1/8)*arcsin(x)

# A similar approach can be taken programmatically.

restart;

with(Student:-Calculus1):

Understand(Int, constant, constantmultiple, sum, difference):

ShowSolution(Int(x^2 * sqrt(1-x^2), x));

"[[∫x^2 sqrt(-x^2+1) ⅆx],[ ,"=",-(∫(sin(u))^4 ⅆu)+∫(sin(u))^2 ⅆu, [change,x=sin(u),u]],[ ,"=",-(∫(-1+cos(2 u))^2 ⅆu)/4+∫(sin(u))^2 ⅆu, [rewrite,(sin(u))^2=1/2-(cos(2 u))/2]],[ ,"=",-(∫(cos(2 u))^2 ⅆu)/4+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [rewrite,(-1+cos(2 u))^2=(cos(2 u))^2-2 cos(2 u)+1]],[ ,"=",-(∫(cos(u1))^2 ⅆu1)/8+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [change,u1=2 u,u1]],[ ,"=",-(∫cos(2 u1) ⅆu1)/16-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [rewrite,(cos(u1))^2=(cos(2 u1))/2+1/2]],[ ,"=",-(∫cos(u2) ⅆu2)/32-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [change,u2=2 u1,u2]],[ ,"=",-(sin(u2))/32-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [cos]],[ ,"=",-(sin(2 u1))/32-u1/16+(∫cos(2 u) ⅆu)/2-u/4+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(∫cos(2 u) ⅆu)/2+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(∫cos(u1) ⅆu1)/4+∫(sin(u))^2 ⅆu, [change,u1=2 u,u1]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(u1))/4+∫(sin(u))^2 ⅆu, [cos]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(2 u))/4+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫cos(2 u) ⅆu)/2, [rewrite,(sin(u))^2=1/2-(cos(2 u))/2]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫cos(u1) ⅆu1)/4, [change,u1=2 u,u1]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(sin(u1))/4, [cos]],[ ,"=",-(sin(4 u))/32+u/8, [revert]],[ ,"=",(sqrt(-x^2+1) x^3)/4-(x sqrt(-x^2+1))/8+(arcsin(x))/8, [revert]]]"

 

Download IntTutor_example.mw

nb. It would be an improvement if the IntTutor automatically utilized the knowledge of which rules had already been programmatically marked as Understood.

Outside of the IntTutor it is also possible to get a complete solution for this problem by using the maxsteps option of the ShowSolution command. (Unfortunately IntTutor does not accept such an option.) Personally I find the constant multiple (and to some extent the constant) rule's steps to make this too verbose and the whole flow less legible. I also think that the default value of maxsteps=25 is too small.

restart;

kernelopts(version);

`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`

# default maxsteps=25
Student:-Calculus1:-ShowSolution(Int(x^2 * sqrt(1-x^2), x));

"[[∫x^2 sqrt(-x^2+1) ⅆx],[ ,"=",∫(-8 u^6+16 u^4-8 u^2)/(u^10+5 u^8+10 u^6+10 u^4+5 u^2+1) ⅆu, [change,u=sqrt((1-x)/(1+x)),u]],[ ,"=",∫(-64/((u^2+1)^4)-8/((u^2+1)^2)+32/((u^2+1)^5)+40/((u^2+1)^3)) ⅆu, [partialfractions]],[ ,"=",∫-64/((u^2+1)^4) ⅆu+∫-8/((u^2+1)^2) ⅆu+∫32/((u^2+1)^5) ⅆu+∫40/((u^2+1)^3) ⅆu, [sum]],[ ,"=",-64 (∫1/((u^2+1)^4) ⅆu)+∫-8/((u^2+1)^2) ⅆu+∫32/((u^2+1)^5) ⅆu+∫40/((u^2+1)^3) ⅆu, [constantmultiple]],[ ,"=",-64 (∫1/((1+(tan(u1))^2)^3) ⅆu1)+∫-8/((u^2+1)^2) ⅆu+∫32/((u^2+1)^5) ⅆu+∫40/((u^2+1)^3) ⅆu, [change,u=tan(u1),u1]],[ ,"=",-64 (∫1/((sec(u1))^6) ⅆu1)+∫-8/((u^2+1)^2) ⅆu+∫32/((u^2+1)^5) ⅆu+∫40/((u^2+1)^3) ⅆu, [rewrite,1/((1+(tan(u1))^2)^3)=1/((sec(u1))^6)]]]"

Student:-Calculus1:-ShowSolution(Int(x^2 * sqrt(1-x^2), x),
                                 maxsteps=50);

"[[∫x^2 sqrt(-x^2+1) ⅆx],[ ,"=",∫(-(sin(u))^4+(sin(u))^2) ⅆu, [change,x=sin(u),u]],[ ,"=",∫-(sin(u))^4 ⅆu+∫(sin(u))^2 ⅆu, [sum]],[ ,"=",-(∫(sin(u))^4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(∫((-1+cos(2 u))^2)/4 ⅆu)+∫(sin(u))^2 ⅆu, [rewrite,(sin(u))^2=1/2-(cos(2 u))/2]],[ ,"=",-(∫(((cos(2 u))^2)/4-(cos(2 u))/2+1/4) ⅆu)+∫(sin(u))^2 ⅆu, [rewrite,((-1+cos(2 u))^2)/4=((cos(2 u))^2)/4-(cos(2 u))/2+1/4]],[ ,"=",-(∫((cos(2 u))^2)/4 ⅆu)-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [sum]],[ ,"=",-(∫(cos(2 u))^2 ⅆu)/4-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(∫((cos(u1))^2)/2 ⅆu1)/4-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [change,u1=2 u,u1]],[ ,"=",-(∫(cos(u1))^2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(∫((cos(2 u1))/2+1/2) ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [rewrite,(cos(u1))^2=(cos(2 u1))/2+1/2]],[ ,"=",-(∫(cos(2 u1))/2 ⅆu1)/8-(∫1/2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [sum]],[ ,"=",-(∫cos(2 u1) ⅆu1)/16-(∫1/2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(∫(cos(u2))/2 ⅆu2)/16-(∫1/2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [change,u2=2 u1,u2]],[ ,"=",-(∫cos(u2) ⅆu2)/32-(∫1/2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(sin(u2))/32-(∫1/2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [cos]],[ ,"=",-(sin(2 u1))/32-(∫1/2 ⅆu1)/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(2 u1))/32-u1/16-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constant]],[ ,"=",-(sin(4 u))/32-u/8-(∫-(cos(2 u))/2 ⅆu)-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32-u/8+(∫cos(2 u) ⅆu)/2-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(sin(4 u))/32-u/8+(∫(cos(u1))/2 ⅆu1)/2-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [change,u1=2 u,u1]],[ ,"=",-(sin(4 u))/32-u/8+(∫cos(u1) ⅆu1)/4-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [constantmultiple]],[ ,"=",-(sin(4 u))/32-u/8+(sin(u1))/4-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [cos]],[ ,"=",-(sin(4 u))/32-u/8+(sin(2 u))/4-(∫1/4 ⅆu)+∫(sin(u))^2 ⅆu, [revert]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(2 u))/4+∫(sin(u))^2 ⅆu, [constant]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(2 u))/4+∫(1/2-(cos(2 u))/2) ⅆu, [rewrite,(sin(u))^2=1/2-(cos(2 u))/2]],[ ,"=",-(sin(4 u))/32-(3 u)/8+(sin(2 u))/4+∫1/2 ⅆu+∫-(cos(2 u))/2 ⅆu, [sum]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4+∫-(cos(2 u))/2 ⅆu, [constant]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫cos(2 u) ⅆu)/2, [constantmultiple]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫(cos(u1))/2 ⅆu1)/2, [change,u1=2 u,u1]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(∫cos(u1) ⅆu1)/4, [constantmultiple]],[ ,"=",-(sin(4 u))/32+u/8+(sin(2 u))/4-(sin(u1))/4, [cos]],[ ,"=",-(sin(4 u))/32+u/8, [revert]],[ ,"=",(sqrt(-x^2+1) x^3)/4-(x sqrt(-x^2+1))/8+(arcsin(x))/8, [revert]]]"

 

Download IntTutot_maxsteps.mw

 

First 148 149 150 151 152 153 154 Last Page 150 of 338