Substituting variables in xmaxima

  • Thread starter coomast
  • Start date
  • Tags
    Variables
In summary, the conversation discusses a problem using the program xmaxima, specifically involving the substitution of variables in a differential equation. An example is given, and a Bessel differential equation is solved to provide a possible solution. The individual is seeking assistance with using xmaxima to solve the problem.
  • #1
coomast
279
1
Hello,

I have a problem using the program xmaxima. It involves the substitution of a new dependent and independent variable in an ordinary differential equation. Let me clearify this with an example of which we know the solution beforehand. So consider the following equation:

[tex]\frac{d^2y}{dx^2}+x \cdot y=0[/tex]

Substituting [itex]y=\sqrt{x}\cdot g(x)[/itex] gives:

[tex]x^2 \cdot \frac{d^2g}{dx^2}+x \cdot \frac{dg}{dx}+\left(x^3-\frac{1}{4}\right) \cdot g=0[/tex]

Substituting in this equation [itex]x^3=t^2[/itex], we get:

[tex]t^2 \cdot \frac{d^2g}{dt^2}+t \cdot \frac{dg}{dt}+\left(\left(\frac{2t}{3}\right)^2 -\left(\frac{1}{3}\right)^2\right) \cdot g=0[/tex]

Which is a Bessel differential equation with solution:

[tex]g(t)=A\cdot J_{1/3}\left(\frac{2t}{3}\right)+ B\cdot Y_{1/3}\left(\frac{2t}{3}\right)[/tex]

Transforming into the previous variables:

[tex]g(x)=A\cdot J_{1/3}\left(\frac{2}{3}x^{3/2}\right)+ B\cdot Y_{1/3}\left(\frac{2}{3}x^{3/2}\right)[/tex]

and thus the solution to the original differential equation:

[tex]y(x)=\sqrt{x}\cdot \left[A\cdot J_{1/3}\left(\frac{2}{3}x^{3/2}\right)+ B\cdot Y_{1/3}\left(\frac{2}{3}x^{3/2}\right)\right][/tex]

Now the question is how does one do that in xmaxima?

best regards,

coomast
 
Physics news on Phys.org
  • #2
Hi Coomast,

I'm not sure how to use xmaxima to solve the given differential equation, but I can offer some advice. Have you tried researching online to see if anyone else has posted a solution to a similar problem using xmaxima? There may be other tutorials or helpful posts that could provide insight into how to solve this problem. Additionally, you could reach out to the developers of xmaxima directly and ask for help.

Good luck!
 
  • #3


Hello coomast,

Thank you for reaching out with your question about using xmaxima for substitution of variables in an ordinary differential equation. It seems like you have a good understanding of the process and have provided a clear example for clarification. In order to perform this substitution in xmaxima, you can use the 'subst' command. For your example, it would look like this:

subst([y=sqrt(x)*g(x),x=t^2], x^2*diff(g,x,2)+x*diff(g,x)+(x^3-1/4)*g=0);

This will give you the Bessel differential equation with the solution you provided. I hope this helps and please let me know if you have any further questions. Best regards,
 

Related to Substituting variables in xmaxima

1. How do I substitute a variable in xmaxima?

To substitute a variable in xmaxima, you can use the subst command. For example, to substitute x with a, you would use subst(a,x,expression). This will replace all instances of x in the expression with a.

2. Can I substitute multiple variables at once in xmaxima?

Yes, you can substitute multiple variables at once in xmaxima by using the subst command with a list of substitutions. For example, subst([a=x,b=y],expression) will substitute x with a and y with b in the expression.

3. How do I substitute a variable with an expression in xmaxima?

To substitute a variable with an expression in xmaxima, you can use the subst command with an equation. For example, subst(a=x^2,expression) will substitute x^2 for a in the expression.

4. How do I undo a substitution in xmaxima?

To undo a substitution in xmaxima, you can use the unsubst command. This will revert the substituted variable back to its original form. For example, unsubst(x,a,expression) will undo the substitution of a for x in the expression.

5. Can I use xmaxima to substitute variables in differential equations?

Yes, xmaxima can be used to substitute variables in differential equations. You can use the subst command with the differential equation function to substitute variables in the equation. For example, subst([a=x,b=y],diff(y,x,2)) will substitute x for a and y for b in the second derivative of y with respect to x.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Mechanical Engineering
Replies
9
Views
1K
  • Advanced Physics Homework Help
Replies
3
Views
438
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
5K
  • Introductory Physics Homework Help
Replies
5
Views
499
Replies
4
Views
429
  • Calculus and Beyond Homework Help
Replies
4
Views
718
  • Introductory Physics Homework Help
Replies
22
Views
463
Replies
10
Views
733
Back
Top