Please join us in a study group devoted to differential equations that begins Monday, April 13. This study group will meet daily, Monday to Friday, over the next two weeks. We will share the excellent lesson videos from the Wolfram U course “Introduction to Differential Equations.” The study group sessions will include time for exercises, discussion and Q&A. This study group will help you achieve the course completion certificate for the “Introduction to Differential Equations” course after you complete the course quizzes.
This is just a reminder that the Differential Equations Study Group begins tomorrow (Monday, April 13).
The Study Group will offer an excellent opportunity to get certified in Differential Equations with guidance from our popular instructor, Luke Titus.
I look forward to seeing you all!
Regarding Lesson 3 and the associated Problem 5: At first I was baffled why the instructor did so much work to come up with a solution that he then verified using DSolveValue[…]. Why not simply use DSolveValue[…] to begin with, as was done in the recent course on Partial Differential Equations.
Then I realized that this instructor is actually teaching us math, not simply Wolfram Language functions!
SUGGESTION (in terms of Problem 5 of Problem Session 1, but can be applied to the population model in Lesson 3 as well): After the text “Move dx to the right-hand side and use Integrate on the left-hand side”, show the result of moving dx to the right-hand side BEFORE integrating:
(1 / {f(x) + 1)) df(x) = 1 * dx
NOW point out that we have separated variables and can integrate each side separately. (The instructor said this, but we didn’t have this form of the equation to look at, so I missed his point.)
When first studying differential equations, I seem to recall we were drawing magnitudes with the vectors in the direction field. Or maybe my memory is not accurage. I mostly recall they were a pain to draw manually – much work.
Is there any advantage to drawing magnitudes with the vector fields, or has everyone agreed that having unit magnitude vectors is the way to go?
Does VectorPlot[] allow one to draw vector fields with something other than a unit magnitude? Have you ever encountered an application where that was useful?
Sure, but most (maybe all?) introductory diff. eq. courses restrict their attention to real-valued solutions. [This is a practical convention, since the course usually follows first-year, real-valued calculus.]
Thank you very much for your comments, Richard. Yes, the main focus of this course is the learn the math and theory behind differential equations while using the Wolfram Language simply as a tool to do some of the work. I appreciate your comment about how we should show more of the intermediate steps and explicitly show what is being integrated before doing the integration. We will take this into account when making future improvements to this course.
You can get an imaginary r(t) function, for example, by using an initial condition on r[0] that is complex. However, we are mostly focusing on the real-valued functions in this course.
You can get different sized arrows using VectorScaling and VectorSizes. For example:
VectorPlot[{y, -x}, {x, -3, 3}, {y, -3, 3}, VectorScaling -> Automatic, VectorSizes -> {0, 1}]
The advantage of using all vectors with a unit length and specifying the magnitudes with colors is to make the plot less cluttered when vector lengths differ a lot in the plot. When using the default unit lengths for the vectors, you can get a legend that shows the length that corresponds to a particular color using PlotLegends
VectorPlot[{y, -x}, {x, -3, 3}, {y, -3, 3}, PlotLegends -> Automatic]
In Lesson 5 (Linear 1st Order Eqns), the example for constant coefficients shows a manual reworking of the solution to bring the arbitrary constant C out of the exponential function, then uses that manually reworked expression as a replacement for y when checking the solution:
y->Function[x,(b+\[ConstantC] Exp[-a x])/a]
When I tried simply replacing y with the generated solution
[In] soln2 = Solve[soln, y[x], Reals]
(y'[x] + a*y[x] == b) /. y -> Function[x, Evaluate[soln2]] // Simplify
[Out] {{y[x] -> (b + E^(-a x + C[1]))/a}}
the result would not simplify to True. It doesn’t perform the indicated replacements:
[In] (y'[x] + a*y[x] == b) /. y -> Function[x, Evaluate[soln2]] // Simplify
[Out]
{{a (y[x] -> (b + E^(-a x + C[1]))/a) + (Derivative[1][y][x] -> -E^(-a x + C[1]))}} == b
QUESTION #1: Why won’t it simplify?
QUESTION #2: Is there a way to have Mathematica do the work, rather than having to rework the solution manually?
Something seems odd in the “Integrating Factor Method” section of Lesson 5 (Linear 1st-Order Eqns). The input
D[Exp[f[x]],x]
generates Exp[f[x]] f’[x] on my system, as expected. However, in the lesson notebook it generates output with an exponent that seems to be a detailed list of possibilities. Pasting it into this box gives an unholy mess, but the first set of possibilities seems to be
1 if 0 <= x < 1 and
0 otherwise
and the second set of possibilities looks like
0 if x is not equal to zero or one;
Indeterminate otherwise
My guess is that the function f is carrying a definition over from a previous cell. SUGGESTION: clear the contents of f before calling D[Exp[f[x]],x]
The issue here is that the form of y[x] in the definition of soln2 isn’t in the right form to make the replacement. This variable has the definition:
soln2={{y\[x\]->(b+E^(-a x+Subscript[\[ConstantC], 1]))/a}}
When making the substitution into the equation, you first need to extract just the functional form for the solution rather than the entire rule. For example:
In[24]:= soln2[[1, 1, 2]]
Out[24]= (b + E^(-a x + C[1]))/a
This form can be substituted into the equation to verify it is true.
In[25]:= (y'\[x\] + a*y\[x\] == b) /. y -> Function[x, Evaluate[soln2[[1, 1, 2]]]]
Out[25]= True
For your second question. There isn’t an easy way to automatically redefine the constant term in the exponential as another constant. If the equation was in a simpler form, you could use a replacement rule such as:
In[26]:= a*Exp[C[1]] /. Exp[C[1]] -> C[2]
Out[26]= a C[2]
However, since the -a*x term is also in the exponential, more complicated pattern matching that wouldn’t be general for all situations would be required pick out just the Exp[C[1]] term. In these cases it’s normally easier to just redefine the arbitrary constants manually.
It does seem like the symbol f has some other definition attached to it. If you clear f before evaluating the derivative, it should give the expected result. For example:
Clear[f]
D[Exp[f[x]], x]
I’m trying to generate nice legends like the ones in the Autonomous Equations section of Lesson 6:
C[1] = -2 C[1] = -1 C[1] = 0 C[1] = 1 C[1] = 2
I tried Table["C[1] = "j, {j, -2, 2}] but this generated
-2 C[1] =
-C[1] =
0
C[1] =
2 C[1] =
In other words, Mathematica did math instead of lexical substitution!
QUESTION: Is there an analog of the C language sprintf function by which we can generate formatted expressions?
REQUEST: Can you please post a URL for the daily study group sessions? Everything I try just takes me to the registration page. It has dial-in information that doesn’t work (no Dial-In ID Number), and I can’t find a link to the session that has surely started by now.
In Section 12 of the course, the symbol Lambda was used for the characteristic equation. Can you explain why that particular symbol was used there? It seems that choice was no accident, but I see no clues to why that was chosen. TY.
In Lesson 7 / Exercises, the solution to Exercise 1 seems to be a non sequitur. The equation is
2*x - y[x] + y'[x]*(2*y[x] - x) == 0
The solution says “The functions N(x,y(x)) and M(x,y(x)) can be identified from the differential equation:”
y1=Integrate[(-s+0),{s,0,x}]
I must have missed something. Lesson 8 is on Picard’s Theorem. The first two exercises for Lesson 8 are indeed connected to Picard’s Theorem, but exercises 8.3 through 8.5 seem unrelated to it.
For example, Exercise 8.3 is:
Transform the following initial value problem to the equivalent problem with the initial value at the origin:
2x - y[x] + y’[x](2*y[x] - x) == 0 and y[1] == 5
The solution doesn’t make sense to me, and Mathematica says the solution’s transformed equation does NOT correspond to the original. The original solution is entirely real; the transformed solution is complex. Perhaps I made a typo, but I triple-checked it and also used copy-and-paste.
Here is a link to the course: Differential Equations, Interactive Online Video Course: Wolfram U
Lambda is chosen just by convention. It’s the symbol a lot of differential equation textbooks use. There isn’t a meaning behind why Lambda is chosen, it’s just the symbol that has commonly been chosen in the past so we decided to use the same symbol just to be consistent with other references.

