# Euler's method

Consider the initial value problem

$$y^{\prime} = \frac{3t^2}{3y^2 - 4} \mbox{,} \qquad y(1) = 0\mbox{.}$$

(a) Use Euler's method with $$h=0.1$$ to obtain approximate values of the solution at $$t=1.2\mbox{, }1.4\mbox{, }1.6\mbox{, and } 1.8$$.

(b) Repeat part (a) with $$h=0.05$$.

(c) Compare the results of parts (a) and (b). Note that they are reasonably close for $$t=1.2\mbox{, }1.4\mbox{, and }1.6$$, but are quite different for $$t=1.8$$. Also note (from the differential equation) that the line tangent to the solution is parallel to the y-axis when $$y=\pm 2/\sqrt{3}\approx \pm 1.155$$. Explain how this might cause such a difference in the calculated values.

My work: (PARTS A & B ARE OK)

(a)

Approximate values of the solution, which were found using the Euler method, follow below:

$$\begin{equation*}\begin{array}{|c|r|} \hline \multicolumn{1}{|c|}{t} & \multicolumn{1}{c|}{h=0.1} \\ \hline 1.2 & -0.166134 \\ 1.4 & -0.410872 \\ 1.6 & -0.804660 \\ 1.8 & 4.15867 \\ \hline \end{array} \end{equation*}$$

(b)

Approximate values of the solution, which were found using the Euler method, follow below:

$$\begin{equation*} \begin{array}{|c|r|r|} \hline \multicolumn{1}{|c|}{t} & \multicolumn{1}{c|}{h=0.1} & \multicolumn{1}{c|}{h=0.05} \\ \hline 1.2 & -0.166134 & -0.174652 \\ 1.4 & -0.410872 & -0.434238 \\ 1.6 & -0.804660 & -0.889140 \\ 1.8 & 4.15867 & -3.09810 \\ \hline \end{array} \end{equation*}$$

(c)

I've plotted the direction field with the solution. You can find it at: http://myplot.cjb.net

The graph shows that the line tangent to the solution is parallel to the y-axis when $$y=\pm 2/\sqrt{3}\approx \pm 1.155$$. That's when the denominator of the fraction in the given differential equation equals zero.

My approximate solution (found with the aid of mathematica's NDSolve) is valid for $$t\leq 1.5978094538975247$$. So, it seems to me that the values found should not be even taken into consideration from that point on. However, if I were to consider values beyond $$t = 1.5978094538975247$$, I'd say that the significant difference in step size may lead each particular approximation to tangent lines with completely different slopes, which ultimately gives those values. I'm not sure. Any help is highly appreciated.

Related Introductory Physics Homework News on Phys.org

#### saltydog

Homework Helper
Thiago, Mathematica's nice huh? You know when you solve it directly, you get an implicit function of y in terms of t. Try this code in Mathematica to see what it looks like and note the problem beyond the vertical slope:

Code:
<<GraphicsImplicitPlot

ImplicitPlot[y^3-4y== t^3-1,{t,-3,3}]
You should get the plot below.

#### Attachments

• 6.5 KB Views: 286

You bet, saltydog! Mathematica is great. Well, thanks for the code. I didn't know how to do that. I've got the same plot here, but then I joined that with the direction field. You can view it at: http://myplot.cjb.net

Anyway, here's what I think I should have for part (c):

In part (a), the closest value to $$y=-2/\sqrt{3}$$ is $$y\left( 1.7 \right)$$, which has a large positive slope (check out the graph). As a result, it follows (Euler method) that $$y\left( 1.8 \right)$$ is positive and reasonably close to the true value ($$\approx 2.445$$).

In part (b), the closest value to $$y=-2/\sqrt{3}$$ is $$y\left( 1.65 \right)$$, which has a large negative slope (check out the graph). As a result, it follows (Euler method) that $$y\left( 1.7 \right)$$ is negative.

Is that it? Thanks again. #### saltydog

Homework Helper
thiago_j said:
As a result, it follows (Euler method) that $$y\left( 1.8 \right)$$ is positive and reasonably close to the true value ($$\approx 2.445$$).
Took some time for me to analyze it too Thiago. You're probably done but this is my take:

I found it a tough problem to analyze but very interesting and illustrates how numerical methods are sometimes limited. I agree with your analysis except for one thing: your assumption above connecting the behavior to the "true value". I don't think they're related in any way. It just so happens that y(1.7)=-1.178, was below the critical line $-2/\sqrt{3}$ with slope (53.366) and so just happen to push the next value up to the point (1.8, 4.159).

Think I might spend a little more time on it in Mathematica.

You're right about that. "Reasonably close" doesn't exactly fit the description of the difference between those numbers. But, other than that, the solution of part (c) seems to be alright. Thank you

Last edited:

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving