tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are answers submitted by tomleslie

but since no-one else is contributing, I'm going to do my bets with some (possibly incomplete?) guidelines

I have downloaded the DirectSearch package as directed in help text but the only result from issuing the command kernelopts(toolboxdir) is " ".

I don't think that this is a very good way to check whether or not you have *successfully* installed the DirectSearch() package. A better alternative would be

  with(LibraryTools):
  FindLibrary(DirectSearch);

If the DirectSearch() package has been installed then the result of the command  If this command givesFindLibrary() will give the location where the DirectSearch.mla repository is installed. If this command gives nothing in return, then Maple cannot find the required file in your current search path. Your current search path is determined by the output of the command libname -as in

libname;

This will return a list of directories where Maple will look for stuff (such as the DirectSearch package). I suppoes it is possible that yu have managed to install the DirectSearch package, somewhere weird, but assuming that you just followed default installation instructions, then I would expect the the DirectSearch package to be in one of two locations (on a Windows machine!)

  1. "C:Program Files\Maple 2022\lib\DirectSearch.mla", or
  2. C:\Users\yourUserName\maple\toolbox

I can only recommend that you have a good look into/around these locations.

##########################################
Another *quick and dirty* method of determing whether or not the DirectSeacrh package has been successfully installed is to use Maple's help facility - because it is a pretty good bet hta if the "help" for the DirectSearch package has been installed then it is a good bet that that the executable DirectSearch package has been installled! Steps are

  1. From a Maple worksheet use the menu entries Help->Maple Help
  2. In the Maple help browser near the top left, there is a "toggle" button labelled Products. I'm pretty sure that (by default) this will be set to 'Maple' - which means that you can only see help for "standard" Maple. However you can change htis to check the tickbox identified as 'User Help'. This will enable the "help" facility for any "user" packages you may have installed (such as DirectSearch)
  3. Having made sure that "user" help has been invoked (see item 2 above), type DirectSearch in the "Search" window. If you get  get a few pages reference in the left-hand pane, then the DirectSearch "help" is available - and by assumption, all DirectSearch commands are available

##########################################

Using Maple Cloud as means of exchanging files between computers. My first reaction is that  it seems like "overkill" (use email?) but it is possible, assuming you understand some limitations, about what you can subsequently do on these computers. This is not something I do often(/ever?) so I am working from the Maple help, part of which states

When you open a package workbook from the MapleCloud, you can use the package commands within that workbook.
However, if you want to be able to access those same package commands from within any Maple document, you must install the package workbook.

This suggests to me that yiu cannot modify or utilise (in a worksheet) anyhting from the Maple Cloud - you have to download and install it on the local machine. Haviing "installed" the relevant package, you can use standard commands from the LibraryTools() package to update the mla file any way you see fit. And then upload the results to Maple |Cloud again

maybe the attached will achieve what you want

  restart;
  padMatrix:= proc( M1, M2 )
                    uses LinearAlgebra:
                    if   op([1,2],M2) > op([1,2],M1)
                    then return `<|>`
                                ( Column(M1, 1..-1),
                                  Vector[column](op([1,1],M1))
                                  $
                                  op([1,2],M2)-op([1,2],M1)
                                );
                    elif op([1,2],M2) < op([1,2],M1)
                    then return `<|>`
                                ( Column(M2, 1..-1),
                                  Vector[column](op([1,1],M2))
                                  $ op([1,2],M1)-op([1,2],M2)
                                );
                    fi;
              end proc:
  A:=LinearAlgebra:-RandomMatrix(9,4):
  B:=LinearAlgebra:-RandomMatrix(6,7):
  padMatrix(A, B);
  padMatrix(B, A);

Matrix(9, 7, {(1, 1) = 25, (1, 2) = -22, (1, 3) = 57, (1, 4) = 27, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (2, 1) = 94, (2, 2) = 45, (2, 3) = 27, (2, 4) = 8, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (3, 1) = 12, (3, 2) = -81, (3, 3) = -93, (3, 4) = 69, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (4, 1) = -2, (4, 2) = -38, (4, 3) = -76, (4, 4) = 99, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (5, 1) = 50, (5, 2) = -18, (5, 3) = -72, (5, 4) = 29, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (6, 1) = 10, (6, 2) = 87, (6, 3) = -2, (6, 4) = 44, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (7, 1) = -16, (7, 2) = 33, (7, 3) = -32, (7, 4) = 92, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (8, 1) = -9, (8, 2) = -98, (8, 3) = -74, (8, 4) = -31, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (9, 1) = -50, (9, 2) = -77, (9, 3) = -4, (9, 4) = 67, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0})

 

Matrix(%id = 36893488148081541356)

(1)

 

Download padMatrix.mw

using 2D input in Document Mode, is shown in the attached

dsolve(diff(y(x), x, x)+diff(y(x), x)+y(x) = 0)

y(x) = _C1*exp(-(1/2)*x)*sin((1/2)*3^(1/2)*x)+_C2*exp(-(1/2)*x)*cos((1/2)*3^(1/2)*x)

(1)

diff(%, x)

diff(y(x), x) = -(1/2)*_C1*exp(-(1/2)*x)*sin((1/2)*3^(1/2)*x)+(1/2)*_C1*exp(-(1/2)*x)*3^(1/2)*cos((1/2)*3^(1/2)*x)-(1/2)*_C2*exp(-(1/2)*x)*cos((1/2)*3^(1/2)*x)-(1/2)*_C2*exp(-(1/2)*x)*3^(1/2)*sin((1/2)*3^(1/2)*x)

(2)

simplify(%)

diff(y(x), x) = (1/2)*exp(-(1/2)*x)*((3^(1/2)*_C1-_C2)*cos((1/2)*3^(1/2)*x)-(3^(1/2)*_C2+_C1)*sin((1/2)*3^(1/2)*x))

(3)

NULL

Download doDiff.mw

just a faiure on the OP's part to understand how Maple *categorizes* an expression, and therefore what will be returned when using convert(expression, list).

The attached contains examples (with comments) for clarification.

  restart:

#
# Certainly not a bug, just OP's failure to understand
# how Maple categorizes expressions
#
# For example, what type is the following expression?
#
  expr:=U(xi)^2*y(xi)^5;
#
# Hmmmm - multiplicative
#
  whattype(expr);
#
# So what are the terms in the multiplicative expression?
#
  convert(expr,list);

U(xi)^2*y(xi)^5

 

`*`

 

[U(xi)^2, y(xi)^5]

(1)

#
# Let's make it more complicated. How does Maple
# categorize the following expression
#
  expr:=U(xi)^2*y(xi)^5*sin(xi);
#
# Hmmmm - multiplicative
#
  whattype(expr);
#
# So what are the terms in the multiplicative expression?
#
  convert(expr,list);

U(xi)^2*y(xi)^5*sin(xi)

 

`*`

 

[U(xi)^2, y(xi)^5, sin(xi)]

(2)

#
# Let's make it *even* more complicated. How does Maple
# categorize the following expression
#
  expr:=U(xi)^2*y(xi)^5*sin(xi)+diff(y(xi), xi);
#
# Hmmmm - additive
#
  whattype(expr);
#
# So what are the terms in the additive expression?
#
  convert(expr,list);

U(xi)^2*y(xi)^5*sin(xi)+diff(y(xi), xi)

 

`+`

 

[U(xi)^2*y(xi)^5*sin(xi), diff(y(xi), xi)]

(3)

#
# Let's simplify a little How does Maple
# categorize the following expression
#
  expr:=U(xi)^2;
#
# Hmmmm - power
#
  whattype(expr);
#
# So what are the terms in the power expression?
#
  convert(expr,list);

U(xi)^2

 

`^`

 

[U(xi), 2]

(4)

 

Download exprtype.mw

square brackets (ie '[]') for simple grouping of terms in an algebraic expression.

See the attached

restartNULL

Lagrangian

 

Leq := (1/2)*R^2*(-cosh(rho1(tau)^2)*(diff(t(tau), tau))^2+(diff(rho1(tau), tau))^2+sinh(rho1(tau)^2)*(diff(theta1(tau), tau))^2)+(1/2)*R^2*(-cosh(rho2(tau)^2)*(diff(t(tau), tau))^2+(diff(rho2(tau), tau))^2+sinh(rho2(tau)^2)*(diff(theta2(tau), tau))^2)-(1/2)*k*rho1(tau)^2-(1/2)*k*rho2(tau)^2-(1/2*(tanh(rho2(tau)-rho1(tau))+1))*(rho2(tau)-rho1(tau))^2; L := subs({diff(rho1(tau), tau) = var4, diff(rho2(tau), tau) = var6, diff(t(tau), tau) = var2, diff(theta1(tau), tau) = var8, diff(theta2(tau), tau) = var10, rho1(tau) = var3, rho2(tau) = var5, t(tau) = var1, theta1(tau) = var7, theta2(tau) = var9}, Leq)

(1/2)*R^2*(-cosh(rho1(tau)^2)*(diff(t(tau), tau))^2+(diff(rho1(tau), tau))^2+sinh(rho1(tau)^2)*(diff(theta1(tau), tau))^2)+(1/2)*R^2*(-cosh(rho2(tau)^2)*(diff(t(tau), tau))^2+(diff(rho2(tau), tau))^2+sinh(rho2(tau)^2)*(diff(theta2(tau), tau))^2)-(1/2)*k*rho1(tau)^2-(1/2)*k*rho2(tau)^2-(1/2)*(-tanh(-rho2(tau)+rho1(tau))+1)*(rho2(tau)-rho1(tau))^2

(1.1)

NULL

Time Equation

 

epr11 := diff(L, var2); epr12 := diff(L, var1); epr13 := subs({var1 = t(tau), var10 = diff(theta2(tau), tau), var2 = diff(t(tau), tau), var3 = rho1(tau), var4 = diff(rho1(tau), tau), var5 = rho2(tau), var6 = diff(rho2(tau), tau), var7 = theta1(tau), var8 = diff(theta1(tau), tau), var9 = theta2(tau)}, epr11); epr14 := subs({var1 = t(tau), var10 = diff(theta2(tau), tau), var2 = diff(t(tau), tau), var3 = rho1(tau), var4 = diff(rho1(tau), tau), var5 = rho2(tau), var6 = diff(rho2(tau), tau), var7 = theta1(tau), var8 = diff(theta1(tau), tau), var9 = theta2(tau)}, epr12); epr15 := diff(epr13, tau); teq := epr15-epr14 = 0

-2*R^2*rho1(tau)*(diff(rho1(tau), tau))*sinh(rho1(tau)^2)*(diff(t(tau), tau))-R^2*cosh(rho1(tau)^2)*(diff(diff(t(tau), tau), tau))-2*R^2*rho2(tau)*(diff(rho2(tau), tau))*sinh(rho2(tau)^2)*(diff(t(tau), tau))-R^2*cosh(rho2(tau)^2)*(diff(diff(t(tau), tau), tau)) = 0

(2.1)

NULL

NULL

Download badBracket.mw

Form the help page for the ShowSolution() command (emphasis added)

The ShowSolution command is used to show the solution steps for a Calculus1 problem, that is, a limit, differentiation or integration problem such as can be expected to be encountered in a single-variable calculus course.

 

use square brackets (ie '[]') for grouping terms in a simple algebraic expression. Square brackets in Maple are used to construct indexable quantities, such as lists.

Just changing these square brackets, code runs - see the attached

restart

with(Optimization); with(plots)

d := .75

.75

(1)

f__s := 200*10^3

200000

(2)

obj := k__v*(d^(1-alpha)+(1-d)^(1-alpha))*2^alpha*f__s^alpha*B__peak^beta/(4*(2*Pi)^(alpha-1)*(.2761+1.7061/(alpha+1.354)))

(1/4)*k__v*(.75^(1-alpha)+.25^(1-alpha))*2^alpha*200000^alpha*B__peak^beta/((2*Pi)^(alpha-1)*(.2761+1.7061/(alpha+1.354)))

(3)

cnsts := [.5 <= alpha, alpha <= 3, .1 <= beta, beta <= 10, .1 <= k__v, k__v <= 10, 0.1e-1 <= B__peak, B__peak <= .3]

[.5 <= alpha, alpha <= 3, .1 <= beta, beta <= 10, .1 <= k__v, k__v <= 10, 0.1e-1 <= B__peak, B__peak <= .3]

(4)

NLPSolve(obj, alpha = .5 .. 3, beta = .1 .. 10, k__v = .1 .. 10, B__peak = 0.1e-1 .. .3, initialpoint = [alpha = .5, beta = .1, k__v = .1, B__peak = 0.1e-1])

[0.967042530117581976e-14, [B__peak = HFloat(0.01), alpha = HFloat(0.4999999998854566), beta = HFloat(8.47772257127817), k__v = HFloat(1.9285093099163284)]]

(5)

``

Download optProb2.mw

 

the attached solves both of your problems


 

  restart:
  with(LinearAlgebra):
  uniqRow:= mat-> local i,j;
                  `if`( member
                        ( true,
                          { seq
                            ( seq
                              ( Equal
                                ( mat[j,..],
                                  mat[i,..]
                                ),
                                i=j+1..op([1,1],mat)
                              ),
                              j=1..op([1,1],mat)
                            )
                          }
                        ),
                        false,
                        true
                      ):
#
# The odds of getting two identical rows in
# a random matrix is infinitesimal
#
  M:=RandomMatrix(10,10):
  uniqRow(M);
#
# Force two rows to be the same and check again
#
  M[5,..]:=M[1,..]:
  uniqRow(M);

true

 

false

(1)

  A:=Matrix(3, 3, [[1, 2, 3], [3, 2, 1], [4, 6, 5]]):
  B:=Matrix(3, 3, [[3, 2, 1], [1, 2, 3], [4, 6, 5]]):
  C:=Matrix(3, 3, [[3, 2, 1], [1, 2, 3], [4, 5, 6]]):
  isPerm:= (mat1, mat2)-> local i,j;
                          `if`
                          ( member
                            ( true,
                              { seq
                                ( `if`
                                  ( Equal
                                    ( mat1,
                                      `<,>`( seq(mat2[i,..], i in j))
                                    ),
                                    true,
                                    false
                                  ),
                                  j in combinat:-permute([$1..op([1,1],mat1)])
                                )
                              }
                            ),
                            true,
                            false
                          ):
  isPerm(A,B);
  isPerm(A,C);

true

 

false

(2)

 


 

Download matManip.mw

The function definition

f:=(r,theta)->I*sinh(theta-Pi/6)+cos(Pi/4)=r;

could be (trivially) rewitten as

f:=(r,theta)->I*sinh(theta-Pi/6)=r-cos(Pi/4);

If both 'theta' and 'r' are real, then the left hand side of this latter equation is purely imaginary, and the right-hand side is purely real. So under what circumstances could they possibly be equal? Only if both sides are zero, which requires theta=Pi/6, r=cos(Pi/4)=sqrt(2)/2.

In other words you original equation is only satisfied at a single point. Now what exactly do you want to plot?

repeated application of Dijkstra's algorithm - as in the attached?

  restart;
  with(GraphTheory):
  doDijk:= proc( GG::Graph, start )
                 local j;
                 uses GraphTheory, ListTools:
                 return seq
                        ( Reverse
                          ( DijkstrasAlgorithm
                            ( G2,
                              start,
                              j
                            )
                          ),
                          j in `minus`
                               ( convert
                                 ( Vertices(G2),
                                   set
                                 ),
                                 {start}
                               )
                         );
          end proc:

 G2:=Graph( [$1..5], {{2,3}, {2,4}, {3,4}, {3,5}}):
 doDijk( G2, 1);
 doDijk( G2, 2);
 doDijk( G2, 3);
 doDijk( G2, 4);
 doDijk( G2, 5);

[infinity, []], [infinity, []], [infinity, []], [infinity, []]

 

[infinity, []], [1, [2, 3]], [1, [2, 4]], [2, [2, 3, 5]]

 

[infinity, []], [1, [3, 2]], [1, [3, 4]], [1, [3, 5]]

 

[infinity, []], [1, [4, 2]], [1, [4, 3]], [2, [4, 3, 5]]

 

[infinity, []], [2, [5, 3, 2]], [1, [5, 3]], [2, [5, 3, 4]]

(1)

 

Download dijk.mw

 

I have with this kind of problem is adequately testing that the proposed code "works" for all possible graphs.

A few potential usage problems are trapped

  1. graphs must be undirected, unweighted
  2. impossible path lengths (eg a path length >= NumberOfVertices)

I have also assumed that in any path, a vertex can only be visited once.

Before using the attached for anything "serious", I strongly suggest that you test it on a few examples of your own!

  restart:
  with(GraphTheory):
  with(SpecialGraphs):
  getPaths:= proc( GG::Graph, vName, depth::integer)
                   local old:=[[vName]], i, j, k, new:
                   uses GraphTheory:

                   if   numelems( Vertices(GG) ) < depth+1
                   then error "Path length too long for Graph":
                   elif IsDirected(GG)
                   then error "Expecting an undirected Graph":
                   elif IsWeighted(GG)
                   then error "Expecting an unweighted Graph":
                   fi;

                   for k from 1 by 1 to depth do
                       new:= [ seq
                               ( seq
                                 ( [j[],i],
                                   i in Neighborhood
                                        ( DeleteVertex
                                          ( GG,
                                            convert
                                            ( j[1..-2],
                                              set
                                            )
                                          ),
                                          j[-1]
                                        )
                                 ),
                                 j in old
                               )
                             ]:
                        new:= [ seq
                                ( `if`
                                  ( numelems(j)=k+1,
                                    j,
                                    NULL
                                  ),
                                  j in new
                                )
                              ];
                        if   numelems(new)>0
                        then old:=new;
                        else return numelems(new), new;
                        fi:
                    od:
                    return numelems(new), new;
             end proc:

#
# Check the graph mentioned by the OP
#
  G1:= CartesianProduct(PathGraph(3), PathGraph(3)):
  getPaths( G1, "1:1", 2);
  getPaths( G1, "1:1", 4);

4, [["1:1", "1:2", "1:3"], ["1:1", "1:2", "2:2"], ["1:1", "2:1", "2:2"], ["1:1", "2:1", "3:1"]]

 

14, [["1:1", "1:2", "1:3", "2:3", "2:2"], ["1:1", "1:2", "1:3", "2:3", "3:3"], ["1:1", "1:2", "2:2", "2:1", "3:1"], ["1:1", "1:2", "2:2", "2:3", "1:3"], ["1:1", "1:2", "2:2", "2:3", "3:3"], ["1:1", "1:2", "2:2", "3:2", "3:1"], ["1:1", "1:2", "2:2", "3:2", "3:3"], ["1:1", "2:1", "2:2", "1:2", "1:3"], ["1:1", "2:1", "2:2", "2:3", "1:3"], ["1:1", "2:1", "2:2", "2:3", "3:3"], ["1:1", "2:1", "2:2", "3:2", "3:1"], ["1:1", "2:1", "2:2", "3:2", "3:3"], ["1:1", "2:1", "3:1", "3:2", "2:2"], ["1:1", "2:1", "3:1", "3:2", "3:3"]]

(1)

#
# Multiple tests on a small graph whose results are
# relatively easy to check
#
  G2:=Graph( [$1..5], {{2,3}, {2,4}, {3,4}, {3,5}}):
  getPaths( G2, 1, 1);
  getPaths( G2, 1, 2);
  getPaths( G2, 1, 3);
  getPaths( G2, 1, 4);
  getPaths( G2, 2, 1);
  getPaths( G2, 2, 2);
  getPaths( G2, 2, 3);
  getPaths( G2, 2, 4);
  getPaths( G2, 3, 1);
  getPaths( G2, 3, 2);
  getPaths( G2, 3, 3);
  getPaths( G2, 3, 4);
  getPaths( G2, 4, 1);
  getPaths( G2, 4, 2);
  getPaths( G2, 4, 3);
  getPaths( G2, 4, 4);
  getPaths( G2, 5, 1);
  getPaths( G2, 5, 2);
  getPaths( G2, 5, 3);
  getPaths( G2, 5, 4);

0, []

 

0, []

 

0, []

 

0, []

 

2, [[2, 3], [2, 4]]

 

3, [[2, 3, 4], [2, 3, 5], [2, 4, 3]]

 

1, [[2, 4, 3, 5]]

 

0, []

 

3, [[3, 2], [3, 4], [3, 5]]

 

2, [[3, 2, 4], [3, 4, 2]]

 

0, []

 

0, []

 

2, [[4, 2], [4, 3]]

 

3, [[4, 2, 3], [4, 3, 2], [4, 3, 5]]

 

1, [[4, 2, 3, 5]]

 

0, []

 

1, [[5, 3]]

 

2, [[5, 3, 2], [5, 3, 4]]

 

2, [[5, 3, 2, 4], [5, 3, 4, 2]]

 

0, []

(2)

 

 

Download doPaths.mw

the attached?

  restart;
  Int(``,x );
  value(%);

Int(``, x)

 

``*x

(1)

 

Download oddInt2.mw

have four equations in four unknowns!

Two of your equations (k__3=0, k__4=0) contain only the variable c__8, and both of these quations are solved for c__8=0.

That leaves you with two equations (k__1=0, k__2=0) in the remaining three unknowns (c__4, c__5 and c__6). The best that Maple (or anyone else can do is to designate one of these as "arbitrary" (which is why the returned solution contains c__6=c__6), and then return expressions for c__4 and c__5 in terms of the "arbitrary" variable c__6

Maple is not "parsing" your 2-D input in the way that you think. Actual parsing is more akin to performing a symbolic-order differentiation, and symbolic-order differentiation only works for integer values - see more comments in the attached.

The ShowSolution() command is only intended to work for "simple" calculus problems. As its help page states (emphasis added)

The ShowSolution command is used to show the solution steps for a Calculus1 problem, that is, a limit, differentiation or integration problem such as can be expected to be encountered in a single-variable calculus course..

So think of the very first "single-variable calculus course" you ever did, and the nature of the problems which you solved. ShowSolution() will (probably) work for most of them - but you didn't do fractional differentiation in such a course!

f := diff(x, [`$`(x, 1/2)])

x

(1)

#
# OP entered above - presumably using palettes.
# So what has (s)he *actually* entered?
#
  f := diff(x, [x $ 1/2]);
#
# Hmmm so what does the second argument in the
# above evaluate to?
#
  [x $ 1/2];
#
# So OP is actually asking for
#
  diff(x, []);
#
# which Maple interprets as don't differentiate!
#
# This is consistent with the "approved" method
# for performing "symbolic order" differentiation
# which would be
#
  dso:=diff(x, x$n);
#
# which we can now evaluate for any INTEGER n -
# see the help at ?diff, symbolicorder
#  
  eval(dso, n=-3);
  eval(dso, n=-2);
  eval(dso, n=-1);
  eval(dso, n=0);
  eval(dso, n=1);

x

 

[]

 

x

 

pochhammer(2-n, n)*x^(1-n)

 

(1/24)*x^4

 

(1/6)*x^3

 

(1/2)*x^2

 

x

 

1

(2)

f := diff(x, [`$`(x, n)]); eval(dso, n = -3); eval(dso, n = -2); eval(dso, n = -1); eval(dso, n = 0); eval(dso, n = 1)

pochhammer(2-n, n)*x^(1-n)

 

(1/24)*x^4

 

(1/6)*x^3

 

(1/2)*x^2

 

x

 

1

(3)

#
# fracdiff works as it should
#
  fracdiff(x, x, 1/2);

2*x^(1/2)/Pi^(1/2)

(4)

  ShowSolution(fracdiff(x, x, 1/2));
#
# The ShowSolution() command is in the
# Student[Calculus1] and cannot be used in the above
# "short form" unless the Student[Calculus1] package
# has been loaded using a with() command.
#
# However even in "long form", as below
#
  Student[Calculus1]:-ShowSolution(fracdiff(x, x, 1/2));
#
# it still won't work, because it is only intended to
# function with *trivial* calculus problems, of the
# type you might come across in your very first
# course in calculus

ShowSolution(2*x^(1/2)/Pi^(1/2))

 

Error, (in Student:-Calculus1:-ShowSolution) input expression does not have any incomplete calculus operations

 

NULL

Download fdiff.mw

the simple-minded answer is that the Student[Calculus1] package only contains a limited range of solution methods. Probably sufficient for the sort of problem which might appear in a student textbook, but certainly not representative of the range of problems which Maple can actually handle.

A generally simple method  of determining whether the Student[Calculus1] package *might* be able to come up with step-by-step solution is to use its Hint() command. If this comes up with something "sensible", then use the Rule() command with whatever the Hint() command returns. Keep repeating this approach until a solution is obtained.

The first "toy" example in the attached shows how repeated application of Hint(), Rule() eventually leads to a result.

However the second example in the attached, with your original integrand, shows that the Student[Calculus1] package cannot come up with an approach for the problem. However, assuming that we just don't like the fact that Maple gets a solution anyway, we can apply "wetware" to determine how Maple *might* have achieved this solution.

See the attached (and please read the comments).

  restart:
  with(Student[Calculus1]):
#
# Let us consider a relatively "simple" problem
#
  expr1:= Int( exp(-t)*cos(t), t);
#
# whose solution can be computed immediately
#
  value(expr1);
#
# Assuming we have no idea how this might
# have been computed, let us ask Maple for a
# "hint" about how the original expression
# *might* be transformed, and then apply
# this provided "hint"
#
  h1:= Hint(expr1);
  expr2:= Rule[h1[1]](expr1);
#
# Well this is still not a "solution", so
# let us ask Maple for a "hint" about this
# expression *might* be transformed, and
# then apply this provided "hint"
#
  h2:= Hint(expr2);
  expr3:= Rule[h2[1]](expr2);
#
# Well this is still not a "solution", so
# let us ask Maple for a "hint" about this
# expression *might* be transformed, and
# then apply this provided "hint"
#
  h3:= Hint(expr3);
  expr4:= Rule[h3](expr3);
# Well this is still not a "solution", so
# let us ask Maple for a "hint" about this
# expression *might* be transformed, and
# then apply this provided "hint"
#
  h4:= Hint(expr4);
  expr4:= Rule[h4](expr4);

Int(exp(-t)*cos(t), t)

 

-(1/2)*exp(-t)*cos(t)+(1/2)*exp(-t)*sin(t)

 

[parts, cos(t), -exp(-t), -sin(t), exp(-t), t], [rewrite, exp(-t)*cos(t) = cos(t)/exp(t)]

 

CALCULUS1OBJECT([1, [], []], {t}) = -exp(-t)*cos(t)-(Int(exp(-t)*sin(t), t))

 

[parts, sin(t), -exp(-t), cos(t), exp(-t), t], [rewrite, exp(-t)*sin(t) = sin(t)/exp(t)]

 

CALCULUS1OBJECT([1, [4], []], {t}) = -exp(-t)*cos(t)+exp(-t)*sin(t)+Int(-exp(-t)*cos(t), t)

 

[constantmultiple]

 

CALCULUS1OBJECT([1, [4, 4], []], {t}) = -exp(-t)*cos(t)+exp(-t)*sin(t)-(Int(exp(-t)*cos(t), t))

 

[solve]

 

CALCULUS1OBJECT([1, [], []], {t}) = -(1/2)*exp(-t)*cos(t)+(1/2)*exp(-t)*sin(t)

(1)

#
# So where does applying the above approach get us
# for the OP's original problem, whihc is trivial
# to solve
#
  expr1:= Int( exp(t^2)*cos(t)^3, t);
  value(expr1);
#
# Answer - not very far, because Hint() provides
# nothing.
#
  h1:= Hint(expr1);
#
# So Hint() has failed - what to do now? Well, if we
# really don't want to just accept Maple's solution,
# then we can apply a simple *thought* process.
#
# And my immediate thought is to convert the cos()
# function to an exponential representation, using
# the simple identity that
#
#       cos(x)=(1/2)*exp(I*x)+exp(-I*x))
#
# as in
#
  expr2:= algsubs( cos(t)=(1/2)*(exp(I*t)+exp(-I*t)),
                   Integrand(expr1)
                 )[];
#
# Then expand it into a sum of terms
#
  expr3:=combine( expand(%), power);
#
# Now split the sum of terms into a list
#
  expr4:=[op(expr3)];
#
# Integrate each of these terms individually
#
  expr5:=int~(expr4, t);
#
# Then just add them
#
  add(expr5);

Int(exp(t^2)*cos(t)^3, t)

 

-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t+3/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t+1/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t-1/2)-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t-3/2)

 

[]

 

(1/8)*exp(t^2)*(exp(I*t)+exp(-I*t))^3

 

(1/8)*exp(t^2+(3*I)*t)+(3/8)*exp(t^2+I*t)+(3/8)*exp(t^2-I*t)+(1/8)*exp(t^2-(3*I)*t)

 

[(1/8)*exp(t^2+(3*I)*t), (3/8)*exp(t^2+I*t), (3/8)*exp(t^2-I*t), (1/8)*exp(t^2-(3*I)*t)]

 

[-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t-3/2), -((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t-1/2), -((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t+1/2), -((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t+3/2)]

 

-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t+3/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t+1/2)-((3/16)*I)*Pi^(1/2)*exp(1/4)*erf(I*t-1/2)-((1/16)*I)*Pi^(1/2)*exp(9/4)*erf(I*t-3/2)

(2)

 

Download doInt.mw

 

First 20 21 22 23 24 25 26 Last Page 22 of 207