-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCh01_FirstOrder.tex
More file actions
2042 lines (1877 loc) · 99.4 KB
/
Ch01_FirstOrder.tex
File metadata and controls
2042 lines (1877 loc) · 99.4 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
\chapter{First Order Differential Equations}
You may recall that in an algebraic equation you are seeking to find a number,
usually\footnote{See the TED Talk
\href{https://www.ted.com/talks/terry_moore_why_is_x_the_unknown}{https://www.ted.com/talks/terry\_moore\_why\_is\_x\_the\_unknown}
to see why we use $x$ for the unknown in Algebra.}
$x$, so that the given equation holds true. For example, we could solve $x+2 = 5$ and
find that $x=3$ is the only value that makes the equal sign true. As another example, we
could solve $x^2-3x+2 = 0$ using the quadratic formula or factoring and find that $x=1$
and $x=2$ are the only solutions. Your high school algebra classes focused on the
techniques necessary to solve many different types of algebraic equations and at this
point you likely have the techniques down pat (right?!).
When solving differential equations we are seeking a slightly different goal. This time
the unknown is a function and the equation relates the derivative(s) of the function to
the function itself. For example, if we consider the simple equation $y'(t) = y(t)$ we could
probably guess (using the rules of calculus) that the only functions that satisfy this
equation are $y(t) = 0$ and $y(t) = Ce^t$. Notice that the solution is not a number but a
function. As another example consider $y''(t) = -y(t)$. In this case you can also use
your intuition from calculus to guess that $y(t)$ is some combination of sines and
cosines: $y(t) = C_1 \sin(t) + C_2 \cos(t)$. Our goal throughout this course is to build
differential equations and find techniques to analyze them. As you might imagine based on
the complexity of the derivative rules in calculus, the techniques to find solutions to
differential equations can sometimes be quite complicated.
\newpage \section{Modeling and Differential Equations}
\begin{problem}
Write several examples of algebraic equations and several examples of differential
equations. Explicitly state the goal in solving these equations. (You do not
actually need to solve the equations)
\end{problem}
\solution{
Algebraic equations:
\begin{flalign*}
x+7 &= 9 \\
x^2 + \sin(x) &= \tan(x) \\
2x+4 &= 7x-\ln(x)
\end{flalign*}
Differential Equations:
\begin{flalign*}
y' &= -\frac{1}{2} y + 4 \\
y'' + y' + y &= 0 \\
\frac{dy}{dt} &= \frac{yt}{t^2 + 1}
\end{flalign*}
}
\begin{definition}[Differential Equation]
A {\bf differential equation} is an equation that relates a function to its
derivative(s). The goal in solving a differential equation is to find the function
that satisfies the given relationship.
\end{definition}
Let's begin by examining a few modeling-type problems where you need to write the
differential equation. After we have a few differential equations we will spend some time
building up the basic solution techniques. \\
% Note: You are expected to have seen several of these techniques already. If these notes
% move to fast then go to the appropriate linked texts in Section \ref{pref:resources} or
% consult your notes from your previous course on differential equations.
\begin{problem}%www.simiode.org Problem 1-001pgf-T-BirthDeathImmigration
Write a differential equation for each of the following situations. Let $P(t)$ be a
function representing the population at time $t$ (measured in years). To help you write each differential equation think
about answering the question: \\
{\it How does the rate of change of the population relate to the size of the population?}
\begin{enumerate}
\item[(a)] In a fragile population each individual has a 50\% chance of surviving in any given year.
\item[(b)] The same fragile population simultaneously has an influx of 10 new
members every year.
\item[(c)] The population in parts (a) and (b) has a reproduction rate of 15\%
each year (measured after the immigrants arrive).
\end{enumerate}
\end{problem}
\solution{
\begin{enumerate}
\item[(a)] $P'(t) = -0.5P$
\item[(b)] $P'(t) = -0.5P + 10$
\item[(c)] $P'(t) = 0.15\left( -0.5P + 10 \right)$
\end{enumerate}
}
\begin{problem}\label{prob:sugar_cube_1}
When dissolving a sugar cube in tea the sugar is being pulled from every face of the
cube. The rate at which the sugar cube dissolves is a differential equation. Which
of the following descriptions of differential equations makes the most sense
physically? Assume that the temperature in the tea is roughly constant during this time.
\begin{enumerate}
\item[(a)] The rate of change of the volume of the sugar cube is proportional to
the current volume of the sugar cube.
\item[(b)] The rate of change of the volume of the sugar cube is proportional to
the current surface area of the sugar cube.
\item[(c)] The rate of change of the volume of the sugar cube is proportional to
the current lengths of the edges of the sugar cube.
\item[(d)] The rate of change of the volume of the sugar cube is constant.
\item[(e)] The rate of change of the volume of the sugar cube is zero.
\end{enumerate}
Once you have a physically reasonable choice from the list above write the associated
differential equation in terms of volume.
\end{problem}
\solution{
Choice (b) is sensible since the dissolution is occuring on the surface and changing
the volume.
\[ \frac{dV}{dt} = k S \]
We know that $S = 6x^2$ and $V = x^3$ so $x = V^{1/3}$. Therefore $S = 6V^{2/3}$ and
the differential equation becomes
\[ \frac{dV}{dt} = 6k V^{2/3}. \]
}
\begin{problem}\label{prob:ice_balls}
Did you know that you could make spherical ice cubes \ldots wait, that name seems
wrong \ldots whatever, check out
\href{https://www.amazon.com/Tovolo-Sphere-Ice-Molds-Set/dp/B007ACTN54}{THIS LINK}.
I have several questions.
\begin{enumerate}
\item[(a)] Finish this sentence:
\begin{quote}
The rate of change of the volume of the ice ball is proportional to
\underline{\hspace{1in}}
\end{quote}
\item[(b)] Write your answer from part (a) as a differential equation. Be sure
that the left-hand and right-hand sides of your differential equation refer to
the same variables.
\item[(c)] I want to know which type of ice will keep my drink cold longer:
sphere-shaped or cube-shaped. Assume that both chunks of ice start with
exactly the same volume. What differential equations would you need to solve
to answer this question?
\end{enumerate}
\end{problem}
\solution{
\begin{enumerate}
\item[(a)] The rate of change of the volume of the ice ball is proportional to the
surface area of the ice ball.
\item[(b)] At first we could write $\frac{dV}{dt} = k S$ where $S$ is the surface
area, but knowing that the surface area of a sphere is $S = 4\pi r^2$ and the
volume is $V = \frac{4}{3} \pi r^3$ we can solve for $r$ in the volume formula
and substitute into the surface area to get
\[ r = \sqrt[3]{\frac{3}{4\pi} V} \quad \implies \quad S = 4 \pi \left(
\frac{3}{4\pi} V
\right)^{2/3}. \]
Therefore the differential equation is
\[ \frac{dV}{dt} = 4 \pi k \left( \frac{3}{4\pi} V \right)^{2/3}. \]
\item[(c)] Finally, the differential equation for the cube is simpler (since the
geometry is simpler) so $S = 6 x^2$ and $V = x^3$ where $x$ is the length of a
side of the cube. Therefore, $x = V^{1/3}$ and $S = 6 V^{2/3}$ and
\[ \frac{dV}{dt} = 6 V^{2/3}. \]
\end{enumerate}
}
\begin{problem}
An ant is building a tunnel. We want to create a differential equation model for the
total time that it takes for the ant to build the tunnel as a function of the length of
the tunnel. Which of the following would be an appropriate differential equation? Let $x$
be the length of the tunnel and let $T(x)$ be the total time to dig a tunnel of length
$x$.
%
% Use what you know about calculus to find a solution for every one of the following
% proposed models and use your solution to help decide which is the correct model.
\begin{enumerate}
\item $T' = kT$ (rate of change of time proportional to total time taken)
\item $T' = kx$ (rate of change of time proportional to current length of the tunnel)
\item $T' = kx^3$ (rate of change of total time proportional to volume).
\item $T' = kS$ (rate of change of total time proportional to the surface area of the end of
the tunnel)
\end{enumerate}
\end{problem}
\solution{
$T' = kx$ (rate is proportional to length of tunnel).
\[ T'=kx \iff T(x) = \frac{k}{2}x^2 \]
So the time that it takes to dig the tunnel is a quadratic function of the length. \\
Show a slope field with $T(0)=0$ and various values of $k$.
}
\begin{problem}
A population of Alaskan Salmon grows according to the following rules:
\begin{itemize}
\item If there are no salmon then the population doesn't change (duh).
\item If the population reaches the carrying capacity for the environment, $M$,
the size of the population stops changing.
\item When the population is growing and is far away from the carrying capacity
the growth rate is roughly proportional to the size of the population.
\end{itemize}
Write a differential equation that models this scenario. Support your model by
discussing what occurs when $P$ is close to $M$ and when $P$ is close to $0$.
\[ \frac{dP}{dt} = \underline{\hspace{2in}} \]
\end{problem}
\solution{
\[ \frac{dP}{dt} = kP \left( 1-\frac{P}{M} \right) \quad \text{or} \quad
\frac{dP}{dt} = kP \left( M-P \right) \]
Note that the units of $k$ are different in the two proposed solutions.
}
\begin{problem}
A spring oscillates in such a way that its acceleration is proportional to its
position relative to an equilibrium point.
\begin{itemize}
\item If the spring is a long way from equilibrium then the acceleration is large
and pointed back toward equilibrium.
\item If the spring is close to equilibrium then the acceleration is small.
\end{itemize}
Let $y(t)$ be the position of the spring.
\[ \frac{d^2 y}{dt^2} = \underline{\hspace{2in}} \]
Sketch a plot of the solution to this differential equation.
\end{problem}
\solution{
\[ \frac{d^2 y}{dt^2} = -ky \]
}
\newpage
\section{Differential Equation Terminology}
\begin{problem}\label{prob:ode_classify}
Work with your partners to group all of the differential equations by common features.
Many of the differential equations could belong to many different groups.
\begin{multicols}{2}
\begin{flalign}
\frac{dy}{dt} &= ty^2 + 5 \\
\dot{\theta} - 2\theta &= 0 \\
x'(t) &= \frac{1}{x} \\
\frac{d^2x}{dt^2} &= -x +\ln(t) \\
\ddot{x} + 2\dot{x} + x &= \sin(t) \\
y' + t\log(y) &= 5 \\
x''' + 4x'' - 8x' + 9x &= 0
\end{flalign}
\columnbreak
\begin{flalign}
y''+y &= 0 \\
\dot{x} + x^2 &= 0 \\
\theta'' + \sin(\theta) &= 0 \\
xx' &= 1 \\
\left( \frac{dy}{dt} \right)^2 + t^2 y &= t + t^2 \\
x' &= \frac{1}{2} x + 5 \\
\theta' \theta'' \theta''' &= 0
\end{flalign}
\end{multicols}
\end{problem}
\begin{problem}
Now return to the differential equations in Problem \ref{prob:ode_classify} and
classify them based on the following terms.
\begin{enumerate}
\item[(a)] linear vs nonlinear
\item[(b)] first order, second order, or third order
\item[(c)] explicitly dependent on time vs implicitly dependent on time
\item[(d)] homogeneous vs non-homogeneous
\end{enumerate}
\end{problem}
\solution{
Linear: 1.2, 1.4, 1.5, 1.7, 1.8, 1.12, 1.13 \\
First Order: 1.1, 1.2, 1.3, 1.6, 1.9, 1.11, 1.13 \\
Second Order: 1.4, 1.5, 1.8, 1.10, 1.12 \\
Explicitly dependend on time: 1.1, 1.4, 1.5, 1.6, 1.12 \\
Homogeneous: 1.2, 1.3, 1.7, 1.8, 1.9, 1.10, 1.11, 1.13, 1.14
}
Now let's get the official definitions on the table. I am expecting that much of this
terminology is familiar to you already from previous classes. We are going to cover this
very quickly and we will be leaving some of the reading and reviewing up to you.
\begin{definition}[First Order Differential Equation]
A {\bf first order differential equation} is a differential equation of the form
\[ y'(t) = f(y,t). \]
Notice that a first order differential equation contains only the first derivative of
the unknown function (hence the name). The function $f$ can be just about anything
and it depends on both $y(t)$ and maybe $t$ explicitly.
\end{definition}
When we encounter new definitions in this class we will always stop and write several
examples associated with that definition. It is usually most informative to give
examples of some things that {\it are} the definition and some that {\it aren't} the
definition. I'll get us started.
\begin{example}
Write several examples of first order differential equations and several examples of
differential equations that are not first order. \\ {\bf Solution:} \\
Examples of first order differential equations:
\begin{flalign*}
\frac{dy}{dt} &= yt+\sin(y) \\
x'(t) &= x \\
\frac{dP}{dx} &= rP(1-P) + h(x) \\
y'(t) &= y\sin(t)
\end{flalign*}
Examples of differential equations that are \underline{not} first order:
\begin{flalign*}
y''(t) &= 2yt + 5y' \text{ (second order)} \\
\frac{d^7y}{dt^7} &= \cos(y) + y'' \text{ (seventh order)} \\
R^{(4)}(t) &= R'''(t) + R''(t) - R'(t) + 17R(t) \text{ (fourth order)}
\end{flalign*}
\end{example}
\begin{definition}[Autonomous Differential Equation]
An {\bf autonomous differential equation} is a differential equation of the form
\[ y'(t) = f(y) \]
where there is no explicit dependence of the independent variable $t$ on the
right-hand side of the equation. A differential equation that has explicit dependence
on $t$ is called {\bf non-autonomous}.
\end{definition}
% To clarify this point consider the following examples:
% \begin{flalign}
% \text{first order autonomous D.E:} \quad & y'(t) = -0.2y(t) + 4 \\
% \text{first order non-autonomous D.E:} \quad & y'(t) = -0.2y(t) + 4t
% \end{flalign}
\begin{problem}
Write three examples of autonomous first order differential equations and three
examples of non-autonomous first order differential equations.
\end{problem}
\begin{definition}[Linear First Order Differential Equation]
A {\bf linear} first order differential equation has the form
\[ y'(t) + P(t) y(t) = Q(t) \qquad \text{or} \qquad y'(t) = -P(t) y(t) + Q(t). \]
The reason for the name ``linear'' is that the right-hand side of this equation is
literally a linear function of $y$. Hence the differential equation can be written as
$y' = f(y)$ where $f(y) = -Py + Q.$
\end{definition}
\begin{problem}
Write three examples of linear first order differential equations and three
examples of nonlinear first order differential equations. In the linear case identify the
``$P$'' and the ``$Q$'' functions.
\end{problem}
\begin{definition}[Homogenous Differential Equations]
A differential equation is called {\bf homogeneous} if, loosely speaking, no terms appear
that do not involve the unknown function. Another way to say this is that every term
in the differential equation will either contain the function $y(t)$ or its
derivatives. A differential equation that is not homogeneous is called {\bf
non-homogeneous}.
\end{definition}
% \begin{problem}
% It is often a good exercise to make examples associated with new definitions. For
% each of the above definitions create an example of a differential equation that {\it
% is} described by the definition and a differential equation that {\it is not}
% described by the definition.
% \end{problem}
\begin{problem}
Write three examples of homogeneous first order differential equations and three
examples of non-homogeneous first order differential equations.
\end{problem}
\begin{problem}
Come up with an example for each of the following descriptions of differential
equations.
\begin{enumerate}
\item[(a)] A linear first order homogeneous differential equation.
\item[(b)] A non-linear first order homogeneous differential equation.
\item[(c)] A linear first order non-autonomous differential equation.
\item[(d)] A linear first order non-autonomous differential equation that is
homogeneous.
\item[(e)] A linear first order non-autonomous differential equation that is
non-homogeneous.
\end{enumerate}
\end{problem}
\solution{
\begin{enumerate}
\item[(a)] $y'=-0.2y$
\item[(b)] $y'=-0.2y^2$
\item[(c)] $y'=-0.2y+t$
\item[(d)] $y'=-0.2yt$
\item[(e)] $y'=-0.2y+3t$
\end{enumerate}
}
\begin{example}
Here are a few examples of homogeneous and non-homogeneous differential equations. The
first four differential equations are linear and the fifth is nonlinear.
\begin{itemize}
\item The differential equation $y' = -0.2y$ is first order homogeneous.
\item The differential equation $y' = -0.2y + 3$ is first order non-homogeneous.
\item The differential equation $y'' + 3y' - 5y = 0$ is second order homogeneous.
\item The differential equation $y'' + 3y' - 5y = 2$ is second order non-homogeneous.
\item The differential equation $v' = g - c v^2$ is first order non-homogeneous (and
nonlinear).
\end{itemize}
\end{example}
\newpage
\section{Solution Technique: Integration}
In the sections that follow we will review (or introduce) some of the primary solution
techniques for first order differential equations. As has been mentioned before, it is
likely that you have seen these techniques before but it is worth your time to blow the
dust off of your memories and to review what you once knew.
\begin{problem}
Consider the function $y(t) = t^2 + 5t + 7$. We know that $y'(t) = 2t + 5$ by taking
the derivative with the power rule. If you encountered the differential equation
\[ y' = 2t+5 \]
without any prior knowledge of $y(t)$, how would you work backwards to get $y(t)$?
Would your answer be unique?
\end{problem}
\begin{problem}
For each of the following differential equations use the rules of Calculus find the
function $y(t)$ that solve the differential equation.
\begin{flalign*}
\frac{dy}{dt} &= 2t + 5 \quad \text{with} \quad y(0) = 3 \\
\frac{dy}{dt} &= \sin(t) \quad \text{with} \quad y(0) = 1 \\
\frac{dy}{dt} &= t e^{-t^2} \quad \text{with} \quad y(0) = 0 \\
\end{flalign*}
\end{problem}
\solution{
\begin{flalign*}
y(t) &= t^2 + 5t + 3 \\
y(t) &= -\cos(t) + 2 \\
y(t) &= -\frac{1}{2} e^{-t^2} + \frac{1}{2}
\end{flalign*}
}
\begin{technique}[Solution via Integration]\label{tech:integration}
To solve
\[ \frac{dy}{dt} = f(t) \]
you can first think of ``multiplying by $dt$'' to get $dy = f(t) dt$. Then integrate both
sides with respect to $t$. Therefore,
\[ y(t) = \int f(t) dt + C = F(t) + C \]
where $F(t)$ is the antiderivative of $f(t)$ such that $F'(t) = f(t)$. Given some
additional piece of information $y(t_0)
= y_0$ we can find the constant $C$ by substituting $t=t_0$ and $y=y_0$ and solving
for $C$. Indeed,
\[ y_0 = F(t_0) + C \quad \implies \quad C = y_0 - F(t_0). \]
\end{technique}
\begin{problem}
Create and solve a first order differential equation (along with an appropriate initial
condition) that can be solved using the technique of integration.
\end{problem}
\begin{problem}
Solve the differential equation
\[ y'(t) = e^{-2t} \quad \text{with} \quad y(0) = 1 \]
\end{problem}
\solution{
\[ y(t) = \int e^{-2t} dt = -\frac{1}{2} e^{-2t} + C \]
\[ y(0)=1 \implies 1 = -\frac{1}{2} + C \implies C = \frac{3}{2} \implies y(t) =
-\frac{1}{2} e^{-2t} + \frac{3}{2} \]
}
\begin{example}
Solve the differential equation $\frac{dx}{dt} = \sin(2t)$ with $x(0) = 3$. \\{\bf
Solution:} \\
We first notice that the differential equation can be written as $\frac{dx}{dt} = f(t)$
where $f(t) = \sin(2t)$. This perfectly matches the form in Technique
\ref{tech:integration} and we see that
\[ x(t) = \int f(t) dt = \int \sin(2t) dt = -\frac{1}{2} \cos(2t) + C. \]
Using the initial condition we see that $3 = -\frac{1}{2} \cos(0) + C$ and since
$\cos(0) = 1$ we see that $C = 3 + \frac{1}{2} = \frac{7}{2}$. Therefore $x(t) =
-\frac{1}{2} \cos(2t) + \frac{7}{2}.$
\end{example}
\newpage
\section{Solution Technique: Separation of Variables}
\begin{problem}\label{prob:separation_1}
Consider the differential equation
\[ \frac{dy}{dt} = y \]
with the initial condition $y(0) = 1$.
\begin{enumerate}
\item[(a)] Putting the differential equation into words: \\ {\it the derivative of
some unknown function is equal to the function itself.} \\
what is the function?
\item[(b)] Allow me to abuse some notation: \\
If you multiply both sides by $dt$ and divide both sides by $y$ we end up with
\[ \frac{dy}{y} = dt. \]
Integrate both sides and solve for $y$.
\item[(c)] Compare your answers to parts (a) and (b).
\end{enumerate}
\end{problem}
\solution{
The solution is clearly $y(t) = Ce^t$ for any real constant $C$.
}
\begin{problem}
In part (b) of the previous problem I said that I was ``abusing notation''. What does
that mean? What notation is being abused?
\end{problem}
\solution{Strictly speaking, the Leibniz notation $dy/dt$ is not a fraction but we are
using it as such. The notation ``$dy/dt$'' is only a notation standing in place of a
limit:
\[ \frac{dy}{dt} = \lim_{h \to 0} \frac{y(t+h) - y(t)}{h}. \]
}
\begin{problem}
Use the same idea used in problem \ref{prob:separation_1} to solve the differential
equation
\[ \frac{dy}{dt} = y\sin(t). \]
Once you have your answer take the derivative and verify that the function that you
found is indeed a solution to the differential equation.
\end{problem}
\solution{
\[ \int \frac{dy}{y} = \int \sin(t) dt \quad \implies \quad \ln(y) = -\cos(t) + C
\quad \implies \quad y(t) = Ce^{-\cos(t)}. \]
To check the answer we differentiate and see that $y'(t) = C\sin(t) e^{-\cos(t)} =
y\sin(t)$.
}
\begin{thm}[Separation of Variables]
To solve a differential equation of the form
\[ \frac{dy}{dt} = f(y)\cdot g(t) \]
Separate and integrate by treating the ``$dy/dt$'' as a fraction\footnote{Technically
speaking the ``$dy/dt$'' is not a fraction it is a shorthand notation for a
limit.}
\[ \int \frac{dy}{f(y)} = \int g(t) dt \]
Notice that the right-hand side of the differential equation factors perfectly hence
separating the variables into the functions $f$ and $g$.
\end{thm}
\begin{proof}
Let's examine separation of variables a bit more closely since there is some calculus
funny business going on. If $\frac{dy}{dt} = f(y) g(t)$ then certainly we can rewrite as
\[ \frac{dy}{dt} = f(y) g(t) \quad \iff \quad \frac{1}{f(y)} \frac{dy}{dt} = g(t). \]
This is true so long as $f(y)$ is nonzero of course. Now if we integrate with respect to
$t$ on both sides we have two valid integrals with respect to time:
\[ \int \frac{1}{f(y(t))} \frac{dy}{dt} dt = \int g(t) dt. \]
From calculus we recall that the quantity $\frac{dy}{dt} dt$ is the differential
$dy$\footnote{No. We are not cancelling the ``$dt$''.}. Hence we arrive at the separated
form
\[ \int \frac{dy}{f(y)} = \int g(t) dt \]
and this ends the proof that separation of variables is a valid technique for solving
differential equations of the form $y' = f(y) g(t)$.
\end{proof}
\begin{problem}
With your partner, write a differential equation that can be solved via separation of
variables. Once you have your equation trade with a different group and solve their
equation.
\end{problem}
\begin{problem}
True or False: Every first order autonomous differential equation is separable. Be
able to defend your answer.
\end{problem}
\solution{True, but the integration may be horrible!}
\begin{problem}
A drug is eliminated from the body via natural metabolism. Assume that there is an
initial amount of $A_0$ drug in the body. Which of the following is the best
differential equation model for the drug removal? Once you have the model solve it
with the appropriate technique.
\begin{enumerate}
\item $A' = -kt$
\item $A' = -kA$
\item $A' = -kA(1-A/N)$
\item $A' = -kAt$
\end{enumerate}
\end{problem}
\solution{
$A'=-kA$ so $A(t) = Ce^{-kt}$ with separation of variables. \\ Show a slope field for
this and discuss stability and equilibrium. Also discuss why the other won't work.
}
\begin{problem}[Separation and Partial Fractions]
A population grows according to the differential equation
\[ \frac{dP}{dt} = 2P\left( 1-\frac{P}{10} \right) \]
with initial condition $P(0) = 5$. This differential equation is separable and
separating the variables gives
\[ \frac{dP}{P(1-P/10)} = 2dt. \]
Integrating both sides yields
\[ \int \frac{dP}{P(1-P/10)} = \int 2dt. \]
The right-hand integral is really easy: $\int 2dt = 2t + C$. The left-hand integral,
on the other hand, takes a bit of work. We will use the method of partial fractions
(see Appendix \ref{app:partial_fractions}) to rewrite the fraction on the left-hand
side as
\[ \frac{1}{P(1-P/10)} = \frac{A}{P} + \frac{B}{1-P/10}. \]
Clearing the fractions gives
\[ 1 = A(1-P/10) + BP, \]
and choosing appropriate values of $P$ gives
\begin{flalign*}
A &= 1 \quad \text{(found by taking $P=0$)} \\
B &= \frac{1}{10} \quad \text{(found by taking $P=10$)}.
\end{flalign*}
Therefore the left-hand integral becomes
\[ \int \frac{dP}{P(1-P/10)} = \int \frac{1}{P} dP + \frac{1}{10} \int
\frac{1}{1-P/10} dP, \]
and these are integrals that you can easily do. Finish this problem.
\end{problem}
\begin{problem}
In problem \ref{prob:sugar_cube_1} we write the differential equation
\[ \frac{dV}{dt} = k S \]
to describe the dissolution of a sugar cube. Here $V$ represents the volume of the
sugar cube and $S$ represents the surface area of the sugar cube. The proportionality
constant $k$ describes how fast the dissolution takes place and is likely a function
of many physical quantities (like what?). If we let $x$ be
the length of a side of the sugar cube recall that the volume and surface area are
defined as $V = x^3$ and $S = 6x^2$. Rewrite the differential equation in terms of
volume only (rewriting surface area in terms of volume) and solve the resulting
differential equation with separation of variables.
\end{problem}
\solution{
If $V = x^3$ then $x = V^{1/3}$ and hence $S = 6x^2 = 6V^{2/3}$. Therefore the
differential equation is
\[ \frac{dV}{dt} = 6k V^{2/3}. \]
Separating variables we get
\[ \int\frac{dV}{V^{2/3}} = \int6kdt \quad \implies \quad 3V^{1/3} = 6kt + C \quad \implies
\quad V = (2kt+C)^3. \]
}
\begin{problem}
In a dog, an intravenous dose of 30 mg of pentobarbital sodium per kilogram of body
weight will usually produce surgical anesthesia. Also in the dog, pentobarbital has a
biological half-life of about 4.5 hours, due almost entirely to metabolism. You
anesthetize a 14-kg dog with the above dose of pentobarbital. Two hours later the
anesthesia is obviously beginning to lighten and you want to restore the original
depth of anesthesia. How many milligrams of pentobarbital sodium should you inject?
Write and solve a differential equation to answer this question.
\end{problem}
\solution{
The simplest differential equation model is
\[ \frac{dP}{dt} = -kP \]
where $P$ is the amount of pentobarbital (in mg) and $t$ is time (in hours). The
solution is clearly $P(t) = C e^{-kt}$ where $C = 420 = (14 \text{kg})(30
\text{mg/kg})$. Since we know the half life of the drug we can find $k$ as
\[ 0.5P_0 = P_0 e^{-k(4.5)} \quad \implies \quad k \approx 0.154033 \]
and hence $P(t) = 420 e^{-0.15033t}$.
}
We'll wrap up this subsection with a few more examples.
\begin{example}
Solve the differential equation
\[ \frac{dy}{dt} = 0.5 y \quad \text{with} \quad y(0) = 7 \]
using the method of separation of variables.\\{\bf Solution:} Notice that this
differential equation is separable since we can separate the functions of $y$ and the
functions of $t$
\[ \frac{dy}{y} = 0.5 dt. \]
Integrating both sides of this equation we get
\[ \int \frac{1}{y} dy = \int 0.5 dt \quad \implies \quad \ln(y) + C_1 = 0.5 t + C_2.
\]
Notice that if we subtract the constant $C_1$ from both sides we actually just get
a new arbitrary constant on the right-hand side. For this reason it is customary to
only write one of the two constants when showing the work for this method
\[ \ln(y) = 0.5 t + C. \]
Exponentiating both sides of this equation gives
\[ y(t) = e^{0.5 t + C} \]
and we can now recognize that this is the same, algebraically, as
\[ y(t) = e^{0.5t} e^C. \]
Furthermore, $e^C$ is just another constant so we write the general solution as
\[ y(t) = Ce^{0.5t}. \]
To get the value of $C$ we substitute $t=0$ into the equation to get $7 = Ce^0$ which
implies that $C= 7$ and the solution is
\[ y(t) = 7e^{0.5t}. \]
\end{example}
\begin{example}
Solve the differential equation
\[ \frac{dy}{dt} = 3y+12 \quad \text{with} \quad y(0) = 2 \]
using separation of variables. \\{\bf Solution:} We're first going to factor the
right-hand side of the differential equation so that the integration that we run in to
is not so hard.
\[ \frac{dy}{dt} = 3(y+4). \]
Separating and integrating gives
\[ \int \frac{1}{y+4} dy = \int 3dt \quad \implies \quad \ln(y+4) = 3t+C. \]
Exponentiating both sides and repeating the same type of algebra as in the previous
example we get
\[ y + 4 = Ce^{3t}. \]
Finally, we can subtract 4 from both sides of the equation to get the general solution
\[ y(t) = Ce^{3t} - 4. \]
Using the initial condition we see that
\[ 2 = C - 4 \quad \implies \quad C=6 \]
which implies that
\[ y(t) = 6 e^{3t} - 4. \]
\end{example}
\begin{example}
Solve the differential equation
\[ \frac{dy}{dt} = \frac{y}{t^2} \quad \text{with} \quad y(1) = 5 \]
using separation of variables. \\{\bf Solution:} We can separate variables,
integrate, and do some algebra to get
\[ \int \frac{dy}{y} = \int \frac{dt}{t^2} \quad \implies \quad \ln(y) =
-\frac{1}{t} + C \quad \implies \quad y(t) = Ce^{-1/t}. \]
Using the condition $y(1) = 5$ we see that $5 = Ce^{-1}$ which implies that $C = 5e$
and the solution to the differential equation is
\[ y(t) = 5e^{1-1/t}. \]
\end{example}
\begin{example}
Solve the differential equation
\[ \frac{dy}{dt} = \frac{2ty}{t^2+1} \]
using separation of variables. \\{\bf Solution:}
If we separate the variables and integrate we see that
\[ \int \frac{dy}{y} = \int \frac{2t}{t^2+1} dt \quad \implies \quad \ln(y) =
\ln(t^2+1)+C. \]
The right-hand integral used the idea of $u$-substitution (you should stop now and work
out the $u$-substitution by hand). Exponentiating both sides gives
\[ y(t) = e^{\ln(t^2+1)+C} = Ce^{\ln(t^2+1)} = C(t^2+1). \]
\end{example}
\begin{example}[Separation and Partial Fractions]
Use separation of variables to solve the differential equation
\[ \frac{dx}{dt} = x(2-x). \]
{\bf Solution:} \\
Separating the variables gives
\[ \int \frac{dx}{x(2-x)} = \int dt \quad \implies \quad \int \frac{dx}{x(2-x)} = t + C. \]
Notice that the left-hand integral is not in a nice form. Let's do some algebra!
If we could write the fraction $\frac{1}{x(2-x)}$ as the sum of two fractions then
maybe we could integrate. If our complicated fraction $\frac{1}{x(2-x)}$ came from the
sum of two fractions then the denominators must have been $x$ and $2-x$. What we
don't know are the numerators. Hence we write the following:
\[ \frac{1}{x(2-x)} = \frac{A}{x} + \frac{B}{2-x}. \]
This is known as a {\it partial fraction decomposition} (more information about partial
fractions can be found in Appendix \ref{app:partial_fractions}).
Multiplying through by the denominator on the left-hand side gives
\[ 1 = A(2-x) + B(x). \]
At this point we can find $A$ and $B$ in two different, but equivalent, ways.
\begin{enumerate}
\item If the equation $1 = A(2-x) + B(x)$ is \underline{always} true then it must
be true in particular for $x=1$ and for $x=0$. Notice that if we take $x=2$ then the
equation becomes $1 = 2B$ so $B = 1/2$. Notice further that if we take $x=0$ then we get $1
= 2A$ so $A = 1/2$. Hence
\[ \frac{1}{x(2-x)} = \frac{1/2}{x} + \frac{1/2}{2-x} = \frac{1}{2} \left(
\frac{1}{x} + \frac{1}{2-x} \right). \]
\item If instead we expand the equation $1 = A(2-x) + B(x)$ to $1 = (B-A)x + 2A$
we can match terms on the left- and right-hand sides so that the coefficients
of the $x$'s gives $0 = (B-A)$ and the constant terms gives $1 = 2A$.
Therefore we see that $A = 1/2$ and hence $B = 1/2$ just as before.
\end{enumerate}
Returning now to the integration problem we have
\[ \int \frac{dx}{x(2-x)} = \frac{1}{2} \int \left( \frac{1}{x} +
\frac{1}{2-x} \right) dx = \frac{1}{2} \left( \ln(x) - \ln(2-x) \right) =
\frac{1}{2} \ln \left( \frac{x}{2-x} \right) \]
where the last step took advantage of a property of logarithms. Putting the
integrations together now we see that
\[ \frac{1}{2} \ln \left( \frac{x}{2-x} \right) = t + C \quad \implies \quad \ln
\left( \frac{x}{2-x} \right) = 2t + C \quad \implies \quad \frac{x}{2-x} = Ce^{2t}
\]
\[ \implies \quad x = Ce^{2t} (2-x) \quad \implies \quad x = 2Ce^{2t} - xCe^{2t} \quad
\implies \quad x + xCe^{2t} = 2Ce^{2t} \]
\[ \implies x\left( 1+Ce^{2t} \right) = 2Ce^{2t} \quad \implies \quad \boxed{x =
\frac{2Ce^{2t}}{1+Ce^{2t}}. } \]
\end{example}
\newpage\section{Solution Technique: Undetermined Coefficients}
\begin{problem}
For each of the following differential equations determine if we can use the method of
integration or separation of variables to solve.
\begin{flalign*}
y' &= 0.5 t \\
y' &= 0.5 y \\
y' &= 0.5 yt \\
y' &= 0.5 y + 1 \\
y' &= 0.5 y + t
\end{flalign*}
\end{problem}
\solution{
You can use integration for the first one and separation for the next three. For the
last one, on the other hand, you can't use either of these techniques.
}
We now turn our attention to solving non-homogeneous differential equations. These
equations can sometimes be solved by separation of variables (like the fourth differential
equation in the previous problem), but not always (e.g. the last one in the previous
problem). The technique used to solve linear non-homogeneous differential equations is called
the {\it method of undetermined coefficients} and is outlined in the next problem.
\begin{problem}
Solve the following first order linear non-homogeneous differential equation by
following the steps outlined.
\[ \frac{dy}{dt} = -0.2 y + 3 \quad \text{with} \quad y(0) = 5 \]
\begin{enumerate}
\item First solve the homogeneous part of the equation using separation of
variables: $y' = -0.2y$.
\[ y_{hom}(t) = \underline{\hspace{1in}} \]
\solution{$y_h(t) = C_0 e^{-0.2t}$}
\item Next conjecture that a {\it particular} solution has the same functional
form as the non-homogeneity. In this case the non-homogeneity is a constant
function so we guess that the particular function is a generic constant
function
\[ y_{particular}(t) = C. \]
\item The full analytic solution to the differential equation is the sum of the
homogeneous and particular solutions: $y(t) = y_{hom}(t) + y_{part}(t)$. Note
that this is only the case for linear differential equations.
\[ y(t) = \underline{\hspace{2in}} \]
\solution{$y(t) = C_0 e^{-0.2t} + C_1$}
\item Substitute the particular solution into the differential equation and see
what equation comes out
\[ \underline{\hspace{1in}} = \underline{\hspace{1in}} \]
\solution{$0=-0.2C_1+3 \implies C_1 = 3/0.2=15$ }
\item Substitute the initial condition into the analytic solution and see what
equation comes out
\[ \underline{\hspace{1in}} = \underline{\hspace{1in}} \]
\solution{$5=C_0 + 15 \implies C_0 = -10$ }
\item Determine the final solution
\solution{$y(t) = -10e^{-0.2t} + 15$}
\end{enumerate}
\end{problem}
Some folks call the technique outlined in the previous problem the ``four step method'',
but I can never keep the ``four steps'' straight. In reality this is just one
of many techniques for solving non-homogeneous differential equations, and this technique
is just mathematical detective work.
\begin{technique}[Solving Non-Homogeneous Differential Equations]
The method of {\it undetermined coefficients} is roughly outlined as:
\begin{enumerate}
\item find a solution for the homogeneous differential equation,
\item conjecture a particular solution for the non-homogeneous differential equation,
\item use the initial condition to find a relationship between some of the
coefficients, and
\item use the particular solution in the differential equation to find the
remaining coefficients.
\end{enumerate}
\end{technique}
More specifically we solve linear non-homogeneous differential equations can be summarized
as follows.
\begin{technique}[Undetermined Coefficients]
To solve a non-homogenous linear differential equation:
\begin{enumerate}
\item Solve the associated homogeneous differential equation.
\item Conjecture a {\it particular solution} that has the same functional form as
the non-homogeneity.
\item Build the full analytic solution as a linear combination of the homogeneous and
particular solutions: $y(t) = y_{hom}(t) + y_{part}(t)$.
\item Substitute the particular solution into the differential equation.
\item Subsitute the intitial condition(s) into the analytic solution.
\item Use the equations that you found in steps 4 and 5 to find the constants.
\end{enumerate}
\end{technique}
\begin{problem}\label{prob:undet_coeff}
For each of the following linear non-homogeneous differential equations write the homogeneous solution and the particular solution.
\begin{enumerate}
\item[(a)] $y' = 3y + 4$ \qquad $y_{hom}(t) = \underline{\hspace{1in}}$\, and\, $y_{part}(t) = \underline{\hspace{1in}}$
\item[(b)] $y' = 3y + 4t$\qquad $y_{hom}(t) = \underline{\hspace{1in}}$\, and\, $y_{part}(t) = \underline{\hspace{1in}}$
\item[(c)] $y' = 3y + 4\sin(t)$\qquad $y_{hom}(t) = \underline{\hspace{1in}}$\,
and\, $y_{part}(t) = \underline{\hspace{1in}}$
\item[(d)] $y' = 3y + 4e^{-t}$\qquad $y_{hom}(t) = \underline{\hspace{1in}}$\,
and\, $y_{part}(t) = \underline{\hspace{1in}}$
\end{enumerate}
\end{problem}
\solution{
\begin{enumerate}
\item[(a)] $y_h(t) = C_0e^{3t}$ and $y_p(t) = C_1$
\item[(b)] $y_h(t) = C_0e^{3t}$ and $y_p(t) = C_1t + C_2$
\item[(c)] $y_h(t) = C_0e^{3t}$ and $y_p(t) = C_1\sin(t) + C_2 \cos(t)$
\item[(d)] $y_h(t) = C_0e^{3t}$ and $y_p(t) = C_1e^{-t}$
\end{enumerate}
}
\begin{problem}
Solve all of the differential equations in the previous problem using either
separation of variables (if possible) or undetermined coefficients. For each one use
$y(0) = 2$.
\end{problem}
\solution{
Part (a)
\[ y' = 3(y+\frac{4}{3}) \implies \cdots\implies y(t) = Ce^{3t} -
\frac{4}{3} \]
\[ y_{hom} = C_0e^{3t} \quad y_{part} = C_1 \implies 0 = 3C_1 + 4 \implies C_1 =
-\frac{4}{3} \]
Using the initial conditions we see that $2 = C_0 - \frac{4}{3} \implies C_0 =
\frac{10}{3}$ so
\[ y(t) = \frac{10}{3} e^{3t} - \frac{4}{3}. \]
Part (b)
\[ y_{hom} = C_0e^{3t} \quad y_{part} = C_1 t + C_2 \implies C_1 = 3(C_1 t + C_2) + 4t
\]
\[ \implies 3C_1 + 4 = 0 \quad \text{and} \quad C_1 = 3C_2 \implies C_1 =
-\frac{4}{3}, \quad C_2 = -\frac{4}{9} \]
\[ \implies y(t) = C_0 e^{3t} - \frac{4}{3} t - \frac{4}{9} \implies 2 = C_0 -
\frac{4}{9} \implies
C_0 = \frac{22}{9} \implies y(t) = \frac{22}{9} e^{3t} - \frac{4}{3}t -
\frac{4}{9} \]
}
\begin{example}
Solve the differential equation $x'(t) = x(t) - 1$ with $x(0) = 5$. \\{\bf
Solution:}\\ Notice that this is a linear non-homogeneous differential equation so we can
use the method of undetermined coefficients.
\begin{enumerate}
\item The homogeneous difference equation is $x' = x$ so we know that
the general homogeneous solution is $x_{hom} = C_0\cdot e^t$.
\item The non-homogeneity is constant so we guess that the particular solution
will be constant: $x_{part} = C_1$.
\item The analytic solution takes the form $x_n = C_0 \cdot e^t + C_1$.
\item Putting the initial condition into the analytic solution gives $5= C_0 +
C_1$.
\item Putting the particular solution into the original differential equation gives
$C_1 - C_1 = C_1 - 1$ which implies that $C_1 = 1$. Together with the
information from the previous step we also now know that $C_0 = 4$.
\item The analytic solution to the differential equation is $a_n = 4 \cdot e^t + 1$.
\end{enumerate}
\end{example}
\begin{example}
Verify that the function $y(t) = (y_0 - 12) e^{-0.25t} + 12$ is a solutions to the
differential equation $\frac{dy}{dt} = -\frac{1}{4} y + 3$ for every initial condition
$y(0) = y_0$. \\{\bf Solution:} \\
The differential equation states that if we substitute the derivative of $y$ into the
left-hand side of the differential equation and $y$ into the right-hand side then we
should get a true statement. Indeed, observe that $y'(t) = -\frac{1}{4}(y_0-12)
e^{-0.25t}$ and therefore
\begin{flalign*}
y'(t) &\stackrel{\text{\small{?}}}{=}
-\frac{1}{4} y(t) + 12 \\
\implies -\frac{1}{4} (y_0 - 12) e^{-0.25t} &\stackrel{\text{\small{?}}}{=} -\frac{1}{4} \left( (y_0 - 12) e^{-0.25t} +
12 \right) + 3 \\
&= \left( -\frac{1}{4} (y_0 - 12) e^{-0.25t} - 3 \right) + 3 \\
&= -\frac{1}{4} (y_0 - 12) e^{-0.25t} \quad \checkmark
\end{flalign*}
Furthermore, for every initial condition $y(0)$ we have
\[ y(0) = (y_0 - 12) e^0 + 12 = y_0 - 12 + 12 = y_0 \quad \checkmark. \]
Therefore the given solution satisfies the differential equation for every possible
initial condition $y(0) = y_0$.
\end{example}
\begin{example}
Solve the differential equation $y' = 2y + 7t$ with $y(0) = 3$. \\{\bf Solution:}\\ We
will use the method of undetermined coefficients.
\begin{enumerate}
\item The homogeneous differential equation is $y' = 2y$ and the associated
solution is $y_{hom}(t) = Ce^{2t}$.
\item The non-homogeneity is linear so we assume that the particular solution is a
linear function. The most general form of a linear function is: $y_{part}(t)
= C_1 t + C_2$.
\item The full general solution is
\[ y(t) = C_0 e^{2t} + C_1 t + C_2. \]
\item Putting the initial condition into the analytic solution gives
\[ 3 = C_0 + C_1 \cdot 0 + C_2. \]
\item Putting the particular solution into the differential equation gives
\[ C_1 = 2(C_1t + C_2) + 7t. \]
We can rewrite this as
\[ 0t + C_1 = 2C_1 t + 2C_2 + 7t, \]
and now we match coefficients to get
\[ 0 = 2C_1 + 7 \]
and
\[ C_1 = 2C_2. \]
From this we see that $C_1 = -7/2$ and $C_2 = -7/4.$ Furthermore, we can use
the result from the previous step to get $C_0 = 3 - C_2 = 3 + 7/4 = 19/4.$
\item The solution is
\[ y(t) = \frac{19}{4} e^{2t} - \frac{7}{2} t - \frac{7}{4}. \]
\end{enumerate}
\end{example}
\begin{example}
Solve the differential equation $y'(t) = \frac{1}{3} y + \cos(t)$ with $y(0) = 1$.
\\{\bf Solution:}\\ We will use the method of undetermined coefficients.
\begin{enumerate}
\item The homogeneous equation is $y' = \frac{1}{3} y$ and the solution is
$y_{hom}(t) = C_0 e^{t/3}$.
\item The non-homogeneity is a trigonometric function so we use a linear
combination of both sine and cosine for the particular solution:
\[ y_{part}(t) = C_1 \cos(t) + C_2 \sin(t). \]
\item The full general solution is
\[ y(t) = C_0 e^{t/3} + C_1 \cos(t) + C_2 \sin(t). \]
\item Putting the initial condition into the analytic solution gives
\[ 1 = C_0 + C_1 + 0 C_2 \quad \implies 1 = C_0 + C_1. \]
\item Putting the particular solution into the differential equation gives
\begin{flalign*}
-C_1 \sin(t) + C_2 \cos(t) = \frac{1}{3} \left( C_1 \cos(t) + C_2 \sin(t)
\right) + \cos(t).
\end{flalign*}
At this point we do some fun algebra. The ``equal sign'' must be true for all
$t$ so we can match the like terms and write two equations. For the
coefficients of the sine functions we must have
\[ -C_1 = \frac{1}{3} C_2. \]
for the coefficients of the cosine functions we must have
\[ C_2 = \frac{1}{3} C_1 + 1. \]
\item We now have three equations with three unknowns. I'll write them very
carefully so we can switch to matrices and solve using Gaussian Elimination
easily.
\begin{flalign*}
1 C_0 + 1 C_1 + 0 C_2 &= 1 \\
0 C_0 + 1 C_1 + \frac{1}{3} C_2 &= 0 \\
0 C_0 + \frac{1}{3} C_1 - 1 C_2 &= -1
\end{flalign*}
Switching to matrix notation we have the augmented system and resulting row reduction
\[ \left( \begin{array}{ccc|c}
1 & 1 & 0 & 1 \\
0 & 1 & 1/3 & 0 \\
0 & 1/3 & -1 & -1 \end{array} \right) \to
\left( \begin{array}{ccc|c}
1 & 0 & -1/3 & 1 \\
0 & 1 & 1/3 & 0 \\
0 & 0 & -10/9 & -1 \end{array} \right) \to
\left( \begin{array}{ccc|c}
1 & 0 & 0 & 13/10 \\
0 & 1 & 0 & -3/10 \\
0 & 0 & 1 & 9/10 \end{array} \right).
\]
\item The analytic solution is
\[ y(t) = \frac{13}{10} e^{t/3} - \frac{3}{10} \cos(t) + \frac{9}{10} \sin(t). \]
\end{enumerate}
\end{example}
% \begin{problem}
% Solve part (c) of problem \ref{prob:undet_coeff} with $y(0) =2$.
% \end{problem}
%
% \begin{problem}
% Solve part (d) of problem \ref{prob:undet_coeff} with $y(0) =2$.
% \end{problem}
\newpage\section{Solution Technique: Integrating Factors}
It is likely that the previous two solution techniques, separation of variables and
undetermined coefficients (four step method), are the ones that you recall best