Why is Mathematica struggling to solve this ODE with a known analytic solution?

  • Context: Mathematica 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around the challenges faced when using Mathematica to solve a specific ordinary differential equation (ODE) that participants assert has a known analytic solution. The focus includes the formulation of the ODE, boundary conditions, and the behavior of Mathematica's solving capabilities.

Discussion Character

  • Technical explanation, Debate/contested, Exploratory

Main Points Raised

  • One participant presents an ODE and claims an analytic solution exists, specifically stating it is quadratic.
  • Another participant suggests providing the ODE in LaTeX for clarity and questions the form of the known solution.
  • A third participant reformulates the ODE and introduces a new variable to simplify the equation, indicating a potential path forward for solving it.
  • Some participants note that while NDSolve works with perturbed boundary conditions, the original boundary conditions may be problematic for DSolve.
  • There is a challenge regarding the correctness of the proposed analytic solution, with one participant questioning the initial conditions associated with it.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the analytic solution and the initial conditions. There is no consensus on why Mathematica struggles to solve the ODE, and multiple approaches and hypotheses are presented without resolution.

Contextual Notes

Some limitations are noted regarding the clarity of the ODE's presentation, the dependency on specific boundary conditions, and the potential for Mathematica to misinterpret the equation's structure.

Who May Find This Useful

Individuals interested in computational methods for solving differential equations, particularly those using Mathematica, may find this discussion relevant.

member 428835
Hi PF!

I am wondering if any of you can explain why Mathematica won't solve this ODE? I know an analytic solution exists (it's quadratic). Any help is greatly appreciated! $f0[x]$ is the name of the function.

Code:
a = -1/5;
DSolve[{-((2 a f0[x])/(1 + a)) + x f0'[x] + 
    2 (f0'[x])^2 + f0[x] f0''[x] == 0, 
  f0[1] == 0, f0'[1] == -1/2}, f0[x], x]
 
Physics news on Phys.org
Some hints to improve your post.
Give us the exact differential equation in LaTeX. having to "translate" hardly readable mathematica code doesn't help getting answers.
You say you know an analytic solution exists, do you know the form as well?

More on topic, have you tried NDSolve to see if mathematica can work with the DE and gives a reasonable result?
 
$$f f''+2f'^2+x f'+\frac{1}{2}f = 0$$ where ##f## is a function of ##x## subject to ##f(1)=0## and ##f'(1)=-1/2##. The analytic solution is ##f=(1-x^2)/2##.

I have tried NDSolve and it works great, provided I perturb the boundary condition as ##f(1)=0.00001##.

Any ideas why it can't figure out the solution?
 
So I've been looking at this for a bit.

First I would get rid of the factor of ##f## from the second derivative term.
From that I would be led to believe you could consider ##g = f^\prime/\sqrt{f}## as a new variable.

##g^\prime = \frac{f^{\prime\prime}}{\sqrt{f}} - \frac{f^\prime}{f}##
Then ##f^{\prime\prime} = \left(g^\prime+\frac{f^\prime}{f}\right)\sqrt{f}##
So we can rewrite your DE as

##\sqrt{f}\left(g^\prime + g\right) + 2 \left(g^\prime\right)^2+xg+\frac{1}{2} = 0##

That's where I got stuck, maybe this gives you some ideas.
I think the key is rewriting the equation such that mathematica recognizes it.
Also wolfram alpha gave me a solution (for different initial values) although no analytical expression.
Since wolfram alpha uses mathematica in the back this is promising.
 
  • Like
Likes   Reactions: member 428835
Are u sure the solution of that differential equation is really f=(1-x^2)/2? I didn't get it because the initial condition of this solution is not same as you mentioned and actually it is f'(1)=-1.

I think the factor 1/2 is missing. However, still I can't get the solution same as you. That's interesting.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K