-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdenotes.tex
More file actions
4184 lines (3863 loc) · 131 KB
/
denotes.tex
File metadata and controls
4184 lines (3863 loc) · 131 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[10pt,driverfallback=hypertex]{report}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage{math}
\usepackage{multirow}
\usepackage{ode}
\usepackage[
type={CC},
modifier={by-sa},
version={4.0},
]{doclicense}
\usepackage{fancyhdr}
\definecolor{heavyblue}{cmyk}{1,1,0,0.25}
\def\thetitle{Notes for Differential Equations}
\def\theauthor{Malcolm Roberts and Samantha Marion}
\hypersetup{
pdftitle=\thetitle{},
pdfpagemode=UseOutlines,
citebordercolor=0 0 1,
colorlinks=true,
allcolors=heavyblue,
breaklinks=true,
pdfauthor={\theauthor{}},
pdfpagetransition=Dissolve,
bookmarks=true
}
\newcounter{showsolutions}
\setcounter{showsolutions}{0}
\newcounter{small}
\setcounter{small}{0}
\ifthenelse{\value{small}=1}{
\usepackage[paperwidth=9.1cm, paperheight=11cm, hmargin={0.17in, 0.17in}, vmargin={0.50in, 0.17in}]{geometry}
}{
\usepackage{geometry}
}
\begin{document}
\sloppy
\pagestyle{fancy}
\renewcommand{\footrulewidth}{1pt}
\cfoot{
\begin{center}
Copyright 2009-2016, Society in Graduate Mathematics and Statistics
\end{center}
\doclicenseThis{}
}
\ifthenelse{\value{small}=0}{
\begin{center}
\ \vspace{2in}
\textsf{\Huge \thetitle{}}
\vspace{2cm}
\ifthenelse{\value{showsolutions}=1}{\vspace{0.5in}{\Huge Instructor's Copy}}
\vspace{2.cm}
{\Large by \theauthor{}}
\vspace{0.5in}
}{ % small-format title page:
\begin{center}
\ \vspace{0.5cm}
\textsf{\LARGE \thetitle{}}
\vspace{2cm}
by \theauthor{}
}
\end{center}
\newpage
\pagestyle{plain}
\pagenumbering{arabic}
\tableofcontents
\newpage
\chapter{Introduction}
Differential equations (abbreviated DEs) are equations involving
functions and their derivatives. For example,
\begin{dmath}
\label{eg1}
\dd{y}{x} = y
\end{dmath}
is a differential equation: $y$ is a function of the independent
variable $x$, and the rate of change of $y$ with respect to $x$ (ie
$\dd{y}{x}$) is equal to the value of $y$. We would like to determine
$y$.
The solution to this equation is
\begin{dmath*}
y = Ce^x,
\end{dmath*}
with $C$ an arbitrary constant. We can check that it is a solution:
\begin{dmath*}
\dd{y}{x}
= \dd{}{x}Ce^x
= Ce^x
= y.
\end{dmath*}
That is, if we plug $y=Ce^x$ into equation~\eqref{eg1}, both sides
match. If we modify this a little bit, say letting $y=Ce^x +x$, then
the left hand side doesn't match the right:
\begin{dmath*}
\dd{y}{x}
= \dd{}{x}(Ce^x +x)
= Ce^x + 1
= y + 1
\neq y,
\end{dmath*}
so it isn't a solution to equation~\eqref{eg1}.
An initial value problem (abbreviated as IVP) is a differential
equation combined with one or more initial conditions. For example,
\begin{dmath*}[compact]
\dd{y}{x}=y, \qquad y(0)=1
\end{dmath*}
is an initial value problem. The differential equation is solved by
$y=Ce^x$, for any value of $C$. However, the only way to satisfy
\begin{dmath*}
y(0)=1
\end{dmath*}
with the solution $y=Ce^x$ is to set $C=1$. That is, the solution to
the initial value problem is
\begin{dmath*}
y=e^x,
\end{dmath*}
since it satisfies both the differential equation and the initial
conditions.
In these brief notes we will describe techniques that can solve a
small variety of different types of differential equations. In
practice, some DEs can be solved analytically, and some can't; when we
can't solve them analytically, we can sometimes find a numerical
solution that gives us an answer that we can use. But the first step
is always to try and find an exact, analytic solution, and it is these
techniques which we will demonstrate in these notes.
\chapter{Separable and Exact DEs}
\ifthenelse{\value{small}=1}{\newpage}
\section{Separable equations}
Separable equations are differential equations of the form
\begin{dmath}
\label{separable}
\boxed{h(y) \dd{y}{x} = g(x)}.
\end{dmath}
These are simple to solve: from equation~\eqref{separable}, we can
just split the derivative and integrate: $ h(y)\, dy = g(x) \, dx$
becomes
\begin{dmath*}
\boxed{ \int h(y) \, dy = \int g(x) \, dx},
\end{dmath*}
and then all we need to do is find the integral and solve for $y$.\\
\noindent\emph{Example}: Consider the equation
\begin{dmath}
\label{separableexample}
y \dd{y}{x} = \sin(x)
\end{dmath}
with initial condition $ y(0) = 1$. Separating and integrating,
\begin{dmath*}
\int y \, dy = \int \sin(x) \, dx,
\end{dmath*}
yields
\begin{dmath*}
\frac{y^2}{2} = -\cos(x) + C
\end{dmath*}
where $C$ is a constant that will be determined by the initial conditions.
Let us now solve for $y$:
\begin{dmath*}
y(x) = \pm \sqrt{2 C -2 \cos(x)}.
\end{dmath*}
Notice that we have two different solutions a positive one and a negative one.
We can use the initial condition $y(0)=1$ to eliminate one. Since
\begin{dmath*}
y(0) = \pm \sqrt{2 C - 2 \cos(0) } = \pm \sqrt{2C-2} =1,
\end{dmath*}
and $1$ is positive, we must choose the positive root.
Thus,
\begin{dmath*}
2C-2 = 1
\end{dmath*}
so
\begin{dmath*}
C=3/2,
\end{dmath*}
and the solution is
\begin{dmath*}
y(x) = \sqrt{3 - 2\cos(x)}.
\end{dmath*}
It's a good idea to check that the solution that you got is correct. This is
pretty easy; just plug the solution into the original equation. From
the above example, $y(x) = \sqrt{3 - 2\cos(x)}$, so
\begin{dmath*}
\dd{y}{x} = \frac{\sin(x)}{\sqrt{3 -2 \cos(x)}}.
\end{dmath*}
Putting this into the left-hand side of
equation~\eqref{separableexample} yields
\begin{dmath*}
y \dd{y}{x}=
\(\sqrt{3 - 2\cos(x)}\) \times \(\frac{\sin(x)}{\sqrt{3 -2 \cos(x)}}\)
= \sin(x),
\end{dmath*}
which matches the right-hand side of
equation~\eqref{separableexample}, and we can be sure that we got the
correct answer. \qed
\section{Exact Equations}
\begin{definition}\emph{Exact equations.}
Homogeneous first-order differential equations can be written in the form
$M(x,y) dx + N(x,y)dy=0.$ If
\begin{dmath*}
\boxed{\pp{M(x,y)}{y} = \pp{N(x,y)}{x}}
\end{dmath*}
then the equation is called \emph{exact}.
\end{definition}
The nice thing with exact differentials is that Poincare's lemma implies
the existence of a function $F$ such that $dF = M(x,y)dx + N(x,y)dy$, and
$dF$, called the differential of $F$, can be thought of as ``how much $F$
changes''. Since $dF=0$, $F$ does not change, i.e.\ it's constant.
Solutions to the exact differential equation are given
implicitly by $F(x,y)=\text{constant}$.
Exact equations are straightforward to solve: after a little bit of trickery,
we simply integrate. Let
\begin{dmath}
\label{exactsol}
\boxed{ F(x,y) = \int M(x,y)\, dx + g(y) }.
\end{dmath}
We require that $\pp{}{y}F(x,y)= N(x,y)$, which will allow us to determine
$g(y)$. That is,
\begin{dmath*}
\pp{F(x,y)}{y}
= \pp{}{y}\(\int M(x,y) \, dx + g(y)\)
= \int \pp{M(x,y)}{y} \, dx + \pp{g(y)}{y}
= N(x,y) + g'(y).
\end{dmath*}
This tells us what $g'(y)$ is, so we now know $g(y)$ up to some constant
$C$. We can put this into equation~\eqref{exactsol}, which gives us the
implicit solution
\begin{dmath}
\label{exactimpl}
\boxed{F(x,y) =C }.
\end{dmath}
In many cases, we can solve for $y$, thus getting an explicit solution
$y=f(x)$ so that $F(x,f(x))=C$, but sometimes all we have for a solution
is something in the form of equation~\eqref{exactimpl}.\\
\noindent\emph{Example}: Solve
\begin{dmath*}
y\, dx + \(y^2 + x \) dy =0
\end{dmath*}
Using the notation above, we have $M(x,y)=y$, and $N(x,y)=y^2 +x$.
This equation is exact, since
\begin{dmath*}[compact]
\dd{}{y}y = 1 = \dd{\(y^2 +x\)}{x}.
\end{dmath*}
So write
\begin{dmath*}
F(x,y)
= \int y \, dx + g(y)
= xy + g(y).
\end{dmath*}
We now need to set $\pp{}{y} F = N$, so
\begin{dmath*}
\pp{}{y}\[xy + g(y)\] = y^2 +x
\end{dmath*}
which implies that $g'(y) = y^2$. We integrate this to get
\begin{dmath}
\label{exactC1}
g(y) = \frac{y^3}{3} + C.
\end{dmath}
The solution is then given by
\begin{dmath}
\label{exactC2}
F(x,y) = xy + \frac{y^3}{3}
\no
=C. \qed
\end{dmath}
(Note that in the above equation we have played fast and loose with
the undetermined constant $C$; in fact, $C$ changed sign between
equation~\eqref{exactC1} and equation~\eqref{exactC2}. We perform this
abuse of notation because $C$ is \emph{undetermined}, so there's not
much point nailing it down to a value until the very last moment.)
\section{Problems}
\begin{enumerate}
\item
Does $y = \sqrt{3-2\sin x}$ solve the differential equation
\begin{dmath*}
y\frac{dy}{dx}=\sin(x)?
\end{dmath*}
\item
Solve the equation
\begin{dmath*}
(2xy + 3) dx + (x^2 - 1) dy = 0
\end{dmath*}
\hidesolution{This is an exact equation}
\item
Solve the logistic map $\dd{y}{x} = y - y^2$ as a separable equation.
\item
Give the general solution to the differential equation
\begin{dmath*}
\ddt{y} = 1 + \frac{1}{y^2}
\end{dmath*}
\hidesolution{
This is a separable equation:
\begin{dmath*}[compact]
\frac{dy}{1+\frac{1}{y^2}} = dt
\implies
\int dt = \int \frac{dy}{1+\frac{1}{y^2}}
\end{dmath*}
But, since
\begin{dmath*}
\frac{1}{1+\frac{1}{y^2}}
= \frac{y^2}{y^2+1}
= 1 - \frac{1}{1+y^2}
\end{dmath*}
so
\begin{dmath*}
t
= \int \(1 - \frac{1}{1+y^2}\) dy
= y + \arctan y + C,
\end{dmath*}
which implicitly defines $y(t)$.
}
\end{enumerate}
\chapter{Linear Equations \& Transformations}
\section{Linear Equations}
Linear equations have the form
\begin{dmath}
\label{linear}
\boxed{\dd{y}{x} + P(x) y = Q(x)}.
\end{dmath}
To solve these equations, we use an \emph{integrating factor}. That is, if
we define the integrating factor $\mu$ as
\begin{dmath*}
\boxed{\mu(x) \doteq \exp\[ \int P(x)\, dx \]},
\end{dmath*}
then notice that
\begin{dmath*}
\dd{}{x}\(\mu y \)
= \dd{\mu}{x} y + \mu \dd{y}{x}
= \mu P(x) y + \mu \dd{y}{x}.
\end{dmath*}
So if we multiply equation~\eqref{linear} by $\mu$, we get
\begin{dmath*}
\dd{}{x}\(\mu y \) = \mu Q,
\end{dmath*}
which we can now solve by taking the integral of both sides with respect to
$x$. Doing this, we get
\begin{dmath*}
d\(\mu y\) = \mu Q \, dx
\end{dmath*}
which implies that
\begin{dmath*}
\mu y = \int \mu Q \, dx + C .
\end{dmath*}
This provides us with the general formula for the integrating factor,
\begin{dmath}
\label{linearf}
\boxed{y = \frac{\int \mu Q \, dx + C}{\mu}.}
\end{dmath}
\\
\noindent \emph{Example}:
\label{linearsec}
Consider the equation
\begin{dmath*}
\dd{y}{x} + \frac{y}{x} = 2 e^x.
\end{dmath*}
We identify $P(x)=1/x$ and $Q(x)=2e^x$. The integrating factor is
\begin{dmath*}
\mu(x) = \mbox{exp}\[\int \frac{1}{x} \, dx \] = e^{\ln x} = x.
\end{dmath*}
Then,
\begin{dmath}
\label{linearex}
\dd{}{x} \(x y \) = 2 x e^x,
\end{dmath}
integrating this gives
\begin{dmath}
x y = \int 2 x e^x \, dx.
\end{dmath}
From the formula (equation~\eqref{linearf}), we have
\begin{dmath}
\label{linearexx}
y = \frac{\int \mu Q \, dx + C}{\mu} = \frac{\int 2 x e^x \, dx + C}{x}.
\end{dmath}
To solve this, we use integration by parts. That is,
$\int u \, dv = uv - \int v\, du$. We choose $u=x$ and $dv = e^x \, dx$, so
$du = dx$, and $v=e^x$. Thus,
\begin{dmath*}
\int x e^x \,dx
= x e^x - \int e^x \,dx
= x e^x - e^x.
\end{dmath*}
Putting this into equation~\eqref{linearexx} yields
\begin{dmath*}
y = 2 e^x \(1 - \frac{1}{x}\) + \frac{C}{x}. \qed
\end{dmath*}
If we had been provided with initial conditions, we would now use them
to determine the value of $C$.
% TODO: show how they can check this?
\section{Equations that can be solved via substitution}
Sometimes it is possible to make a substitution to transform a
differential equation into something that we already know how to
solve. For example, the integrating factor technique transforms
linear equations into separable equations. This can be a very powerful
technique. Unfortunately, each type of equation needs its own
particular substitution and this makes substitution not as straight
forward as other techniques.
The most important examples of substitution are linear, homogeneous,
and Bernoulli equations. We also consider two other types of equations
that can be solved by substitution, which are shown in the flow chart in
Figure~\ref{fig:first_order_flow_shar}.
\subsubsection{Homogeneous Equations}
\begin{dmath*}
\boxed{\dd{y}{x} = f\(\frac{y}{x}\)}.
\end{dmath*}
We solve this by substituting $v=y/x$, so that
\begin{dmath*}[compact]
\dd{y}{x} = v + x \dd{v}{x},
\quad \implies \quad
v + x \dd{v}{x} = f(v),
\end{dmath*}
which can be written as the separable equation
\begin{dmath*}
\boxed{\dd{v}{x} = \frac{f(v) -v}{x}}.
\end{dmath*}
\noindent \emph{Example}:
\begin{dmath*}[compact]
\dd{y}{x} = \frac{x}{y}, \mbox{ with } y(1) = 2.
\end{dmath*}
This is homogeneous, so let $v=y/x$, and then $f(v) = \frac{1}{v}$, so
\begin{dmath*}
v + x \dd{v}{x} = \frac{1}{v}.
\end{dmath*}
The equation is now separable:
\begin{dmath*}
\frac{1}{\frac{1}{v} -v} \, dv = \frac{1}{x}\, dx.
\end{dmath*}
Integrating both sides gives
\begin{dmath*}
\int \frac{v}{1-v^2}dv = \int \frac{1}{x} \, dx.
\end{dmath*}
Let $u = 1-v^2$ to solve the integral:
\begin{dmath*}
-\frac{1}{2} \int \frac{1}{u}du = \ln x+ \ln C
\end{dmath*}
which implies that
\begin{dmath*}
\ln\(u\)=\ln\(1-v^2 \) = \ln \frac{C}{x^2}.
\end{dmath*}
In terms of $v$, we have
which implies that
\begin{dmath*}
v = \pm \sqrt{1 - \frac{C}{x^2}}.
\end{dmath*}
Expressing this in terms of the original variable $y$ gives
\begin{dmath*}
y = \pm x \sqrt{1 - \frac{C}{x^2}}.
\end{dmath*}
The initial condition is $y(1)=2$, so we choose the positive root, and
find $C$ by setting $x=1$, $y=2$, i.e.\
\begin{dmath*}
2 = 1 \times \sqrt{1-C}
\end{dmath*}
so $C=-3$. The solution of the initial value problem is
\begin{dmath*}
y = x \sqrt{1 + \frac{3}{x^2}}.
\end{dmath*}
This would be a good one to check. Note that
\begin{dmath*}[compact]
\dd{y}{x}
= \sqrt{1+\frac{3}{x^2}} - \frac{3/x^2}{\sqrt{1+\frac{3}{x^2}}}
= \frac{1}{\sqrt{1+\frac{3}{x^2}}}
= \frac{x}{y},
\end{dmath*}
so the solution is correct. \qed
\subsubsection{Bernoulli Equations}
Bernoulli equations are differential equations of the form
\begin{dmath*}
\boxed{ \dd{y}{x} + P(x) y = Q(x)y^n}
\end{dmath*}
where $n$ can be an integer or a rational number. Note that if
$n=0$ or $n=1$, then this is just a linear equation.
We solve this by substituting $v=y^{1-n}$, so that
\begin{dmath*}[compact]
\dd{v}{x} = \(1-n\)y^{-n}\dd{y}{x}
\end{dmath*}
and rearranging gives
\begin{dmath*}
\frac{1}{1-n} \dd{v}{x} + P(x)v = Q(x).
\end{dmath*}
We can write this as a linear equation:
\begin{dmath*}
\boxed{\dd{v}{x} + (1-n)P(x)v = (1-n)Q(x).}
\end{dmath*}
\noindent\emph{Example}:
\begin{dmath*}
\dd{y}{x} -\half \frac{y}{x} = -e^x y^3
\end{dmath*}
Since $n=3$, choose $v=y^{-2}$. Then
\begin{dmath*}[compact]
\dd{v}{x} = -2 y^{-3} \dd{y}{x}
\quad \implies \quad
\dd{v}{x} = -2 y^{-3}\( \half \frac{y}{x} - e^x y^3\)
\quad \implies \quad
\dd{v}{x} + \frac{v}{x} = 2 e^x,
\end{dmath*}
which is the linear equation given as the example from section \ref{linearsec}.
\qed
%\subsubsection{Equations with Linear Coefficients}
% Question: doesn't case 1 follow from case 2?
% Sam's answer: Yes, I believe it does
%\be
%\(a_1 x + b_1 y + c_1\)dx +2 \(a_2 x + b_2 y + c_2\)dy =0
%\ee
%We deal with equations where $a_1 b_2 \neq a_2 b_1$, for which there
%are two cases:
%\begin{enumerate}
%\item if $c_1=c_2=0$, then
%\be
%\dd{y}{x} = -\frac{a_1 + b_1 \(y/x\)}{a_2+ b_2 \(y/x\)},
%\ee
%which is homogeneous.
%\item if either $c_1$ or $c_2$ is not zero, then we use the substitution
%$x=u+h$ and $y=v+k$, with $h$ and $k$ constants which obey the relationship
%\be
%a_1h + b_1 k + c_1 &=&0 \\ \nonumber
%a_2h + b_2 k + c_2 &=&0 .
%\ee
%This reduces the problem to
%\be
%\dd{v}{u} = -\frac{a_1 + b_1 \(v/u\)}{a_2 + b_2 \(v/u\)},
%\ee
%which is homogeneous in $u$ and $v$.
%\end{enumerate}
\newpage
\subsection{Flow chart for solving first-order DEs}
As we have seen, it is sometimes necessary to use several
transformations in order to solve a given DE. Each type of first
order DE that we have seen so far is ultimately separable, as outlined
in the flow chart below, or exact.
%FIXME: refer to this somewhere
\vspace{0.5in}
\begin{figure}[htbp]
\centering
\ifthenelse{\value{small}=0}{
\includegraphics{figures/firstorderchart}
}{
\includegraphics[width=\textwidth]{figures/firstorderchart}
}
\caption{Flow chart for solving first-order DEs}
\label{fig:first_order_flow_shar}
\end{figure}
\section{Problems}
\begin{enumerate}
\item
% a linear equation
Solve the initial value problem
\begin{dmath*}
(x^2 + 1) \frac{dy}{dx} + 4xy = 4x,
\end{dmath*}
with initial condition
\begin{dmath*}
y(0) =\ 0\ \text{ or }\ 1\
\end{dmath*}
(choose one, and circle your choice).
\hidesolution{Rewrite this equation as
\begin{dmath*}
\frac{dy}{dx} + \frac{4x}{x^2+1}y = \frac{4x}{x^2+1}
\end{dmath*}
which is linear with $P(x) = \frac{4x}{x^2+1}$, so let
\begin{dmath*}
\mu(x) = \exp \left(\int P(x)\, dx \right)
= \exp \left( \int \frac{4x}{x^2+1} \, dx \right) = \exp(2 \ln (x^2+1))
= \exp(\ln (x^2+1)^2) = (x^2+1)^2.
\end{dmath*}
(Note that we can omit the absolute value bars around $x^2+1$ since it is
always positive.) Then multiplying through by $\mu(x)$ we obtain
\begin{dmath*}
(x+1)^2 \frac{dy}{dx} + 4x(x^2+1)y
= 4x(x^2+1)
\end{dmath*}
\begin{dmath*}
\frac{d}{dx} \left( (x^2+1)y \right)
= 4x^3+4x.
\end{dmath*}
Integrating yields
\begin{dmath*}
(x^2+1)^2 y
= x^4 + 2x^2 + C
\end{dmath*}
\begin{dmath*}
y = \frac{x^4 + 2x^2 + C}{(x^2+1)^2}.
\end{dmath*}
Solving the IVP $y(0) = 1$ gives $C = 1$, then the solution is
\begin{dmath*}
y = \frac{x^4 + 2x^2 + 1}{(x^2+1)^2}
= \frac{(x^2+1)^2}{(x^2+1)^2}
\equiv 1.
\end{dmath*}
It's actually obvious from just looking at the problem that $y \equiv 1$ is a
solution to this IVP, so you could just have wrote it down and quoted the
result that linear equations have unique solutions to IVPs.
This equation is also separable since we may rewrite it as
\begin{dmath*}
(x^2+1) \frac{dy}{dx}
= 4x(1-y) \qquad\Rightarrow\qquad \frac{1}{1-y} \frac{dy}{dx}
= \frac{4x}{x^2+1}
\end{dmath*}
but in dividing by $1-y$ we have destroyed the solution $y \equiv 1$,
which is the (unique) solution to the initial value problem $y(0) =
1$, so it is not possible to solve the IVP $y(0) = 1$ by separating
this equation. This is why I let you choose instead the IVP $y(0) =
0$, which has solution
\begin{dmath*}
y = 1 - \frac{1}{(x^2+1)^2}
\end{dmath*}
}
\item
Joe headed out to the bar in his new Thinsulate jacket, but drank
too much and passed out on the way home. Ignoring the heat that his body
produces, his temperature is determined by Newton's law of cooling.
Determine Joe's temperature $T$ at time $t$ by solving Newton's law of cooling,
both as a separation problem and a linear problem
\begin{dmath*}
\dd{T}{t} = -r\(T - T_{\text{env}}\),
\end{dmath*}
where $T(0)=37$, $T_{\text{env}}=-40$, and $r=5$ (Thinsulate's r-value).
\hidesolution{TODO: write solution.}
\item
Solve the logistic map,
\begin{dmath*}
\dd{y}{x} = y - y^2.
\end{dmath*}
as a Bernoulli equation
\hidesolution{TODO: write solution.}
\item
Solve the differential equation
\begin{dmath*}
\dd{y}{x} = \frac{y}{x} + x^2y^2.
\end{dmath*}
\hidesolution{
This is a Bernoulli equation with $n=2$, so set $v=y^{1-n}=y^{-1}$. Then,
\begin{dmath*}
\dd{y}{x} = \frac{-1}{x^2}\dd{v}{x}.
\end{dmath*}
Then,
\begin{dmath*}[compact]
\frac{-1}{v^2}v' - \frac{1}{xv} = \frac{x^2}{v^2}
\implies
v' = \frac{v}{x} - x^2
\end{dmath*}
Now, let $w=v/x$, which implies that
\begin{dmath*}
w + x \dd{w}{x} = w -x^2 \implies \dd{w}{x} = -x^2
\end{dmath*}
Thus, $w = - \half x^2 + C$, so
\begin{dmath*}[compact]
w=\frac{v}{x}
= \frac{1}{xy} \implies \frac{1}{y} = \frac{-x^3}{2} + Cx
\implies y = \frac{1}{-x^3/2 + Cx}.
\end{dmath*}
}
\item
Equations of the form $\dd{y}{x} = f(ax+by)$ may be transformed into a
separable equation via the substitution $v=ax + by$. Using this technique,
solve the differential equation
\begin{dmath*}
\dd{y}{x} = - \(4x -y\)^2
\end{dmath*}
\hidesolution{
Let $v=4x-y$, so $y'=4-v'$. Then
\begin{dmath*}
v' = v^2 +4 = (v-2)(v+2),
\end{dmath*}
which is separable. That is, $\frac{dv}{(v-2)(v+2)} = dx$, so, using
partial fractions,
\begin{dmath*}
\int \frac{1/4}{v-2} -\frac{1/4}{v+2} \, dv
= \frac{1}{4} \ln\abs{v-2} - \frac{1}{4} \ln\abs{v+2} = x + C.
\end{dmath*}
Substituting $v=4x-y$ back in, we get the implicit solution
\begin{dmath*}
\ln\abs{\frac{4x-y-2}{4x-y+2}} = 4x +C.
\end{dmath*}
Solving for $y$ yields
\begin{dmath*}
y = \frac{Ce^{4x}\(4x+2\) -4x +2}{1-Ce^{4x}}.
\end{dmath*}
}
\item
Equations of the form
\begin{dmath*}
\(a_1 x + b_1 y + c_1\)dx +\(a_2 x + b_2 y + c_2\)dy =0
\end{dmath*}
can be transformed into homogeneous equations by using the substitution
$x=u+h$ and $y=v+k$, with $h$ and $k$ constants which obey the relationship
\bee
a_1h + b_1 k + c_1 &=&0 \\
a_2h + b_2 k + c_2 &=&0 .
\eee
This reduces the problem to
\begin{dmath*}
\dd{v}{u} = -\frac{a_1 + b_1 \(v/u\)}{a_2 + b_2 \(v/u\)},
\end{dmath*}
which is homogeneous in $u$ and $v$.
Solve the differential equation
\begin{dmath*}
\(2y + 2\) dx + \(x +y+2\) dy=0
\end{dmath*}
using this technique.
\end{enumerate}
\chapter{Second-order Linear Equations}
\ifthenelse{\value{small}=1}{\newpage}
\newcommand\ycomb{\alpha y_1 + \beta y_2}
% Text chapter 4.2
Let $a,b,c$ be real numbers. Second order equations of the form
\begin{dmath}
\label{sec2hom}
a \ddtwo{y}{t} + b \dd{y}{t} + cy =0
\end{dmath}
are linear in $y$. If both $y_1$ and $y_2$ are solutions to
equation~\eqref{sec2hom}, and $\alpha$ and $\beta$ are constants, then
$$\ycomb$$
is a linear combination of $y_1$ and $y_2$. If we put this linear combination
into the original differential equation, we get:
\begin{dmath*}
a \ddtwo{\(\ycomb\)}{t} + b \dd{\(\ycomb\)}{t} + c \(\ycomb \)
= \alpha\(a \ddtwo{y_1}{t} + b \dd{y_1}{t} + cy_1 \)
+\beta\(a \ddtwo{y_2}{t} + b \dd{y_2}{t} + cy_2 \)
= \alpha \times 0 +\beta \times 0 =0.
\end{dmath*}
In other words, $\ycomb$, which is a linear combination of $y_1$ and $y_2$, is
also a solution to equation~\eqref{sec2hom}. Being able to use this linearity
is a powerful tool that we can use to solve this very important type of
differential equation. We will, in general, have two solutions to these
second-order differential equations, and we will need two initial values to
fully determine the solution. This is expressed in the following theorem:
\begin{theorem}
Let $b$, $c$, $Y_0$, and $Y_1 \in \mathbb{R}$.
Then, the initial value problem
\begin{dmath*}[compact]
y'' + by' + cy =0, \qquad y(0)=Y_0, \quad y'(0)=Y_1
\end{dmath*}
has a unique solution.
\end{theorem}
\section{Homogeneous Linear Equations}
The behaviour of these systems is basically exponential. To see this,
set $y=e^{rt}$. Then, putting this into equation (\ref{sec2hom}), we get
\begin{dmath*}
a r^2 e^{rt} + b r e^{rt} + ce^{rt}
= e^{rt} \( ar^2 + br + c\) =0.
\end{dmath*}
Since $e^{rt}$ is never zero, there is no harm in dividing by it. This leaves
us with the \emph{characteristic equation},
\begin{dmath*}
\boxed{ar^2 + br + c =0},
\end{dmath*}
which allows us to determine $r$ using the quadratic formula. In this way
we get two solutions,
\begin{dmath*}
\boxed{y_1=e^{r_1 t}\text{ and }y_2=e^{r_2 t}},
\end{dmath*}
from the two solutions $r_1$ and $r_2$ of the characteristic equation.\\
\noindent\emph{Example}: Solve the second-order homogeneous equation
\begin{dmath*}
\ddtwo{y}{t} - y =0,
\end{dmath*}
with initial conditions $y(0) =1, \, y'(0) =0.$\\
\noindent\emph{Solution}:
Setting $y=e^{rt}$, this becomes
\begin{dmath*}
e^{rt} \(r^2 -1 \)
= e^{rt} \(r-1\)\(r+1\)
=0,
\end{dmath*}
so $r_1=-1$, and $r_2=1$. Thus,
\begin{dmath*}[compact]
y_1(t)
= e^{-t}, \qquad y_2(t)
=e^t.
\end{dmath*}
The solution $y$ is therefore a linear combination of $y_1$ and $y_2$. That is,
\begin{dmath*}
y(t)
= \alpha y_1(t) + \beta y_2(t)
= \alpha e^{-t} + \beta e^t,
\end{dmath*}
for some constants $\alpha$ and $\beta$ that are determined by the initial
conditions. Since $y(0)=1$,
\begin{dmath}
\label{sec2ab1}
y(0) = \alpha +\beta =1.
\end{dmath}
Since $y'(0)=0$, and $y'(t) = -\alpha e^{-t} + \beta e^t$,
\begin{dmath}
\label{sec2ab2}
y'(0) = -\alpha + \beta =0.
\end{dmath}
Combining equations~\eqref{sec2ab1} and~\eqref{sec2ab2}, it is easy to see
that $\alpha = \beta =\half$. The solution is therefore
\begin{dmath*}
y = \frac{e^{-t} + e^t}{2}. \qed
\end{dmath*}
\section{Dealing with complex roots}
%Text section 4.3
So far, we've seen only problems where the roots of the characteristic
equation are real. Of course, this isn't always the case, but we can deal with
this using \emph{Euler's Formula},
\begin{dmath*}
\boxed{e^{i\theta} = \cos(\theta) + i \sin(\theta)}.
\end{dmath*}
For example, if we get $r_{1,2}= 4\pm 2i$, then solutions are a linear
combination of
\begin{dmath*}
e^{(4+2i)t}
=e^{4t}e^{i2t}
=e^{4t} \(\cos(2t) + i \sin(2t)\)
\end{dmath*}
and
\begin{dmath*}
e^{(4-2i)t}=e^{4t}e^{-i2t}=e^{4t} \(\cos(2t) - i \sin(2t)\).
\end{dmath*}
An easy way to get all linear combinations is to just set
$$
y_1(t) = e^{4t} \cos(2t), \qquad y_2(t) = e^{4t} \sin(2t).
$$
\noindent\emph{Example}: Give the general solution to
\begin{dmath*}
\ddtwo{y}{t} + 1 =0
\end{dmath*}
with initial conditions $y(0) =1, \, y'(0) =0.$\\
\noindent\emph{Solution}:
The characteristic equation is
\begin{dmath*}[compact]
r^2 +1 =0 \quad \implies \quad r = \pm i.
\end{dmath*}
The solution is then a linear combination of
\begin{dmath*}[compact]
y_1(t) = e^{0t}\cos(t) = \cos(t), \qquad
y_2(t) = e^{0t}\sin(t) = \sin(t)
\end{dmath*}
Setting $y(t)=\alpha \cos(t) + \beta \sin(t)$, we can input the initial
conditions to get
\bee
y(0) &=& \alpha\cos(0) + \beta\sin(0) = \alpha =1,
\\
y'(0) &=& -\alpha\sin(0) + \beta\cos(0) =\beta =0.
\eee
The solution to the IVP is then $y(t) = \cos(t)$. \qed
\section{Dealing with repeated roots}
In the above section, we were lucky, since we had two independent
roots. Two independent roots gave two independent solutions $y_1$ and
$y_2$, which we used to solve the two initial values for the
problem. When we have repeated roots, we still need to make sure that
we have two independent solutions. How do we get this? Well, just
multiply one solution by $t$\footnote{Note that if $y=e^{rt}$ is a
solution, with $r$ a double-root. To simplify matters, let $a=1$.
Then,
\begin{dmath*}
\frac{d^2 y}{dt^2} + b\ddt{y} +c y
=
\(\ddt{} -r \) \(\ddt{} -r \)y.
\end{dmath*}
Now, $\(\ddt{}-r\)e^{rt}=0$, so it's easy to see that
$\(\ddt{}-r\)\[te^{rt}\]=e^{rt}$. Then,
\begin{dmath*}
\frac{d^2 \(te^{rt}\)}{dt^2} + b\ddt{\(te^{rt}\)} +c \(te^{rt}\)
\no=
\(\ddt{} -r \) \(\ddt{} -r \)\(te^{rt}\)
\no=
\(\ddt{} -r \) e^{rt}
\no=0,
\end{dmath*}
so $te^{rt}$ is indeed another solution. Moreover, it is clear that
$e^{rt}$ and $te^{rt}$ are linearly independent.}.
For example, suppose that we solved the characteristic equation and got
$r_1=r_2=r$. We still get one solution out of this, namely
\begin{dmath*}
y_1(t) =e^{rt}.
\end{dmath*}
To get the second solution, just take
\begin{dmath*}
y_2(t) = t y_1(t) = t e^{rt}.
\end{dmath*}
This works since $\ddtwo{t}{t}=0$, so the extra $t$ in $y_2$ is eventually
killed, and everything cancels out nicely.
\\
\noindent\emph{Example}: Give the general solution to
\begin{dmath*}
\ddtwo{y}{t} - 2 \dd{y}{t}+1 =0
\end{dmath*}
with initial conditions $y(0) =1, \, y'(0) =0.$\\
\noindent\emph{Solution}:
The characteristic equation for this problem is
\begin{dmath*}
r^2 - 2r +1 = (r-1)(r-1) =0,
\end{dmath*}
which has the double root $r_1=r_2=1$. Thus, set
$y_1(t) = e^t$ and $y_2=t e^t$, so
\begin{dmath*}
y = \alpha e^t + \beta t e^t
\end{dmath*}
Now,
\begin{dmath*}[compact]
y(0) = \alpha = 1.
\end{dmath*}
For the second condition, calculate that
$y'(t) = \alpha e^t + \beta e^t + \beta te^t$. Thus
\begin{dmath*}[compact]
y'(0) = \alpha + \beta =0.
\end{dmath*}
Thus, $\alpha=1$ and $\beta =-1$, so the solution is
\begin{dmath*}[compact]
y(t) = e^t - te^t. \qed
\end{dmath*}
\newpage
\subsection{Flow chart for $2^{\text{nd}}$-order linear homogeneous DEs}
\ifthenelse{\value{small}=0}{