Professional Documents
Culture Documents
Learning Part 2 Version Mathcad PDF
Learning Part 2 Version Mathcad PDF
1
2 1. EXPLICITLY SOLVABLE FIRST ORDER DIFFERENTIAL EQUATIONS
. Click the upper limit place holder, type 3 and click the lower limit
place holder type 0. Now click the integrant place holder type
x^5 -e^3x -sin(3x)
Notice you need to hit the space bar twice before -sin(3x) . Of
course you also need hit space bar twice too before entering -e^3x to
exit the square root operator.
In general, you will need to hit the space bar as many times
an need to escape the power(subscript, division, etc.) mode
before you enter next term.
The backslash \ brings up the square root operator. Finally in
the integration variable place holder type x(see Figure 2 for the position
of each place holder.) Now hold down[Ctrl] to type [.] key and click on
4 1. EXPLICITLY SOLVABLE FIRST ORDER DIFFERENTIAL EQUATIONS
any region outside the bounding box, if not in the auto execution
mode hit [F9] too, to find the antiderivative
Z
√ 2 3 1 1
x + 2 − e3x − sin(3x) dx → (x + 2) 2 − exp3x + cos(3x)
3 3 3
. Here exp represent exponential function. From Calculus, we know
that
Z
√ 2 3 1 1
x + 2 − e3x − sin(3x) dx = (x + 2) 2 − exp3x + cos(3x) + C.
3 3 3
Mathcad omits the C for believing you know it! Remember C is im-
portant when we try to find a particular solution for a given, so called,
”initial” condition.
Example 1.3. Find a function x(t) such that x0 (t) = 2t and x(0) =
3.
which leads to
(1) x(t) = t2 + C.
Evaluate this x(t) at t = 0 we have
x(0) = 02 + C = C
So the requirement x(0) = 3 implies C = 3. Hence x(t) = t2 + 3.
Notice if we drop the C from (1), we would not be able to find x(t)
that satisfies x(0) = 3! a
The problem of finding a particular solution with initial condition is
called initial value problem, which we will discuss in the later section. a
Practice
1. Find the following definite integral using Mathcad .
R2
(a) −1 x3 − x cos(x2 + 1) dx
R4 3
(b) 1 x +4x−5
x+1
dx
R 0 3x
(c) −5 e − x2x+3 dx
R 10
(d) −1 x2 − x sec(x2 + 1) dx
2. Find the following indefinite integral using Mathcad .
R p
(a) x5 − x (x2 + 1) dx
R 3
(b) x x+4x−5
2 +1 dx
2. SEPARABLE EQUATIONS 5
R x−3
(c) (x2 +3)(x+5) dx
R 2
(d) x tan(x + 1) dx
2. Separable equations
If we let x be the independent variable and y be the dependent
variable, a separable ODE is given by,
y 0 = f (x)g(y)
dy
where both f and g are given one variable functions and y 0 = dx is the
derivative of y(x) with respect to x and y(x) is the unknown function
we want to find out.
When g(y) ≡ 1, that is g(y) is a constant function whose value is
always 1, the separable ODE becomes
y 0 = f (x)
, which is sometimes called integrable ODE . The general solution to
the integrable ODE is the antiderivative of f (x), i.e.
Z
y(x) = f (x) dx
and type x^2 +3 in the place holder for integrant and x in the inte-
grating variable place holder. Then press [Ctrl][.] and click on any
region outside the bounding box to get the result. Sometime you
might need to hit [F9] too if the auto execution mode is turn off. a
6 1. EXPLICITLY SOLVABLE FIRST ORDER DIFFERENTIAL EQUATIONS
Now open Mathcad window, click any blank area, type [Ctrl][I] to get
the antiderivative operator Z
d
dy
Solution Write y 0 as dx , multiply both sides of the equation by
2
(sin(y) + 3y + 3)dy and take antiderivative, we have
Z Z
sin(y) + 3y + 3 dy = ex + 2x dx
2
and Z
ex + 2x dx = ex + x2 + C
Practice
8 1. EXPLICITLY SOLVABLE FIRST ORDER DIFFERENTIAL EQUATIONS
Project
Click on the
The picture above exhibits the situation when the air condition fails
at t = 0, so after a out 14 hours, the room temperature is the same as
the outside temperature!
Practice
(1) Find general solution to the following problem
(a) y 0 + 4xy = x2
(b) ex y 0 + ex y = sin(x)
(c) xy 0 = 2y + x3 cos(x)
2
(d) y 0 = 2xy + 3x2 ex
(e) (x2 + 4)y 0 + 3xy = x
3 2
(f) (x2 + 1)y 0 + 3x3 y = 6xe− 2 x
(2) Application: The equation y 0 = ky models wide range of
natural phenomena–any involving a quantity whose time rate
of change is proportional to its current size.
Continuously Compounded Interest Rate: Let P (t)
denote principle at time t, which will earn interest with rate
r(t) and compounded continuously, we have dP dt
= rP. Now
3. LINEAR EQUATIONS AND BERNOULLI EQUATIONS 11
suppose r(t) = cos2 (t), find the general solution and graph
the solution for several different value for the constant C in
the same coordinate. Explain the long time behavior of the
solutions.
Drug Elimination: Let A(t) be the amount of cer-
tain drug in the bloodstream, measured by the excess over the
natural level of the drug. Then in many situations A(t) will
decline at a rate proportional to the current excess amount.
That is
dA
= −λA,
dt
where λ > 0 is called the elimination parameter of the drug.
Suppose for one type of drug, λ(t) = t21+4 find the general
solution. Discuss its longtime behavior by graphing several
solutions in the same coordinate.
So R
a dt
1 e
x= = Ã !
v R R
be a dt dt + C
So
eat eat
x= Ã !=Ã !,
R b at
beat dt + C a
e +C
a
x(t) = ,
b + aCe−at
a
However, for general first order ODE , the problem is not so nice,
the following theorem is a little bit hard to state and to understand.
Theorem 4.2. Let f (t, x) be defined on interval I. If the partial
derivative of f (t, x) with respect to y (denoted as ∂f∂y
(t,x)
, reads ”par-
tial f(t,x) over partial y”) and f (t, x) are continuous at an open disk
centered at (t0 , x0 ), then the initial value problem
½ 0
x = f (t, x)
x(t0 ) = x0
has an unique solution on some open interval containing the point t0 .
Remark 4.1. We will not discuss this existence and uniqueness
theorem for general ODE . But we would like to make some comments.
- To find ∂f∂t
(t,x)
, you just need to treat x variable as a constant,
for example, let f (t, x) = t2 x3 + 3t − 4x, we have ∂f∂t (t,x)
=
3
2tx +3, here 4x is a constant with respect to t, so the derivative
is 0, and x3 is also a constant, so t2 x3 when taking derivative
against t we have 2tx3 . Therefore finding partial derivative is
as easy as to find ordinary derivative.
- This theorem only guarantees a solution defined for t in an
open interval, which might be a bounded interval. For example
1
x0 = x2 , we see that x(t) = − t+c is the general solution, if
c = −2 then the solution is only defined on interval (0, 2) as
1
x(t) = − t−2 will become undefined at t = 2.
- Some time we could have more than one solution that satisfies
2
the same initial condition, for example, for x0 = x 3 and x(0) =
0 we have two different solution, one is x(t) = 0 another one
16 1. EXPLICITLY SOLVABLE FIRST ORDER DIFFERENTIAL EQUATIONS
1 2
is x(t) = t 3 . The reason is that for f (t, x) = x 3 , ∂f∂x
(t,x) 1
= √
3x
Step one: Set f (x) = 0 solve the equation. The solution is called the
critical number of the equation x0 = f (x).
Step two: Plot the solution one a horizontal (or vertical)number line.
The solutions will divide the line into intervals (segments),
pick any number from each interval (segment) and determine
the sign of the value of f (x) at the picked value.
Step three: Using the sign in Step two to draw arrow on each segment, a
right (up) arrow for positive sign and a left (down) arrow for
negative sign.
Example 5.1. Draw phase diagram for x0 = (x − 1)(x + 2)(x − 3).
Solution
Step one: Here f (x) = (x − 1)(x + 2)(x − 3) so f (x) = 0 gives
(x − 1)(x + 2)(x − 3) = 0,
and it has three solutions, x = −2, 1, 3
Step two: Plot the three solution on the number line,
we see that we have four intervals: (-∞, -2), (-2, 1), (1, 3), and (3, ∞).
The following table organizes our computation,
Interval (-∞, -2) (-2, 1) (1, 3) (3, ∞)
x-value picked -3 0 2 4
Value of f(x)= f(-3)=(-3-1) f(0)=(0-1)(0+2) f(2)=(2-1)(2+2) f(4)=(4-1)(4+2)
(x-1)(x+2)(x-3) (-3+2)(-3-3) (0-3)=6 (2-3)=-4 (4-3)=24
=-24
Sign of f (x) - + - +
Step three: Draw the arrows on the number line. A right arrow for
positive sign and a left arrow for negative sign. a
3
19, 3).
With this information and the phase diagram we have the following
picture of typical solutions for x0 = (x − 1)(x + 2)(x − 3),
John Doe
SS# 000-00-0000
font. You can do this for headings etc. Graph Vector field
Goal: Familiar your self with an many different kind of vector fields,
defined by x0 = f (t, x), as possible and identify many general features
of solutions, especially the following features,
• Does the equation has constant solutions? A constant solu-
tion is shown in vector field as horizontal line segments since
constant solution has slope equals zero.
• Does solutions converge to an particular solution in the lang
run?
• Do solutions grow to infinite an a finite time? Her vertical bars
indicate a solution might become unbounded in short time.
• Do solutions display any periodicity? We know sin(t) has pe-
riod of 2π and solution curve repeats itself. Here large interval
for t might be needed.
You can use the following functions
• f (t, x) = sin(x)
• f (t, x) = cos(t)
• f (t, x) = x(x − 1)
• f (t, x) = et x + sin(x)
• f (t, x) = x + xsin(t)
You should use the provide Mathcad file at the website
www.unf.edu/∼mzhan/vectorfield.mcd
as a starting point and superimpose solutions to the vector fields so
support your observation.