DE.01 Transition from Calculus to DiffEq:
The Exponential Differential Equation
       y'[t]+r y[t]=f[t] 
TUTORIALS

Needs["Graphics`Colors`"];
Graphics`Colors`GosiaGreen=RGBColor[0, 0.392187, 0];
Needs["Graphics`FilledPlot`"];
Off[General::spell];
Off[General::spell1];
Off[ParametricPlot3D::ppcom];
Off[ParametricPlot::ppcom];
Off[Plot::plnr];
Needs["Calculus`Master`"];
Off[Unique::"usym"];
SetOptions[Limit,Analytic->True];

CMView = {2.7, 1.6, 1.2};

Off[Graphics::gpt];

New Vector Drawers

(* :Title:  NewVectorDraw  *)
(* :Author: Bruce Carpenter *)
(* :Summary:  Construct 2 and 3 dimensional vectors,
     arrows, and arrowheads as graphics 
     objects.
*)
(* :Date:  Copyright 1997, Math Everywhere, Inc. 
*)
(*  :Drawbacks:  Since the vectors are drawn out of 
     context, the shapes of the arrowheads are only 
     correct with AspectRatio set to Automatic.
*)
BeginPackage["Vector3D`","Graphics`Colors`"];

Axes3D::usage = "Axes3D[a, b] creates a Graphics3D object of cartesian axes with x, y, and z running from -a/3 to a, and with axes labels b units beyond the tips of the axes.  Axes3D[a] is Axes3D[a, a/8].";

Perpend::usage = "Perpend[a] returns a unit vector which is perpendicular to the vector a.";

Arrow::usage = "Arrow[a] produces a 2 or 3 dimensional vector from the origin to a. Arrow[a, Tail -> tail] gives a vector from tail to a.";
	
Vector::usage = "Vector[a, b] gives a 2D or 3D vector from a to b.";

ArrowHead::usage = "ArrowHead[a, vec] produces an arrowhead with its tip placed at the point a, pointing in the direction of the vector vec.";

Tail::usage = "Tail -> point puts the tail of the vector at point.";

Norm::usage = "Norm[vec] returns the Euclidean length of vec.";

Normalize::usage = "Normalize[vec] returns a unit vector in the direction of vec, provided vec is nonzero.";

Aperture::usage = "Aperture is the ratio of the radius of the base to the length of the head of a vector.";

TipSize::usage = "TipSize specifies an absolute size for the inner tip length of the head of a vector.";

TipRatio::usage = "TipRatio is the ratio of the inner length of the arrowhead to the length of the shaft of a vector.";

HeadRatio::usage = "HeadRatio is the ratio of the outer length of the arrowhead to the length of the shaft of a vector.";

HeadSize::usage = "HeadSize specifies an absolute size for the head of a vector.";

ScaleFactor::usage = "ScaleFactor specifies the amount to scale a vector in length and may be either a number or a pure function.";

ZeroVectorPointSize::usage = "ZeroVectorPointSize is the size of the point used to represent a zero vector.";

Options[Vector] = Options[Arrow] = Options[ArrowHead] =
{HeadRatio -> 0.18, TipRatio -> 0.14, Aperture -> 0.3, ScaleFactor -> 1, HeadType -> Polygon, ShaftQ -> True, EdgesQ -> True, VectorColor -> RGBColor[0,0,1], ShaftWidth -> 0.005, ZeroVectorPointSize -> 0.01};
		
Begin["`Private`"];

SetOptions[ParametricPlot,AspectRatio -> Automatic];
SetOptions[Plot,AspectRatio -> Automatic];
SetOptions[Graphics,AspectRatio -> Automatic];

Axes3D[u_,v_] := 
      Graphics3D[{
            {Blue,Line[{{-u/3,0,0},{u,0,0}}]},
                    Text["x",{u + v,0,0}],
            {Blue,Line[{{0,-u/3,0},{0,u,0}}]},
                    Text["y",{0, u + v,0}],
            {Blue,Line[{{0,0,-u/3},{0,0,u}}]},
                    Text["z",{0,0,u + v}]}]; 
Axes3D[u_] := Axes3D[u,u/8];
				
Norm[a_?VectorQ] := N[Sqrt[a.a]];

Normalize[a_?VectorQ] := If[a.a == 0, a, a/Norm[a]];

Perpend[a_?VectorQ] := Normalize[{a[[2]],-a[[1]]}]/;Length[a]==2
Perpend[a_?VectorQ] := Normalize[If[a[[1]]==0,{1,0,0},{0,a[[3]],-a[[2]]}]]/;Length[a]==3

Base3D = Table[{Cos[2 k Pi/8.], Sin[2 k Pi/8.]},{k,0,8}]; 

Vector[from_?VectorQ, to_?VectorQ, opts___] := Module[
   {sq, sw, ht, hs, hr, tr, ap, sf, vc, zvps, diff = to - from, tip},
   {sq, sw, ht, hs, hr, ts, tr, ap, sf, vc, zvps} = {ShaftQ, ShaftWidth, HeadType, HeadSize, HeadRatio, TipSize, TipRatio, Aperture, ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts} /. Options[Vector];
   If[from==to, Return[Graphics[{PointSize[zvps],vc,Point[from]}]]];
   diff = If[NumberQ[N[sf]], sf diff, sf[diff]];
   tip = from + diff;
   If[NumberQ[hs], hr = hs/Norm[diff]; tr = 0.75 hr];
   If[NumberQ[ts], tr = ts/Norm[diff]];
   Graphics[{If[sq,{vc,Thickness[sw],Line[{from,tip - tr diff}]},{}],
      With[{trans = ap hr Norm[diff] Perpend[diff]},
      {vc, Thickness[sw], ht[{tip,
                   (tip - hr diff + trans),
                   (tip - tr diff),
                   (tip - hr diff - trans),tip}]}]}]
] /; Length[from]==Length[to]==2

Vector[from_?VectorQ, to_?VectorQ, opts___] := Module[
   {sq, eq, sw, hs, hr, tr,ap, sf, vc, zvps, diff = to - from, tip},
   {sq, eq, sw, hs, hr, ap, sf, vc, zvps} = {ShaftQ, EdgesQ, ShaftWidth, HeadSize, HeadRatio, Aperture, ScaleFactor, VectorColor, ZeroVectorPointSize} /. {opts} /. Options[Vector];
   If[from==to, Return[Graphics3D[{PointSize[zvps],vc,Point[from]}]]];
   diff = If[NumberQ[N[sf]], sf diff, sf[diff]];
   tip = from + diff;
   If[NumberQ[hs], hr = hs/Norm[diff]];
   tr = hr/2;
   Graphics3D[{If[sq,{vc,Thickness[sw],Line[{from,tip-tr diff}]},{}], If[eq, {}, EdgeForm[]], {SurfaceColor[vc],
      With[{temp = Perpend[diff]},
      Polygon[Append[#,tip]]& /@ Partition[(tip - hr diff + #)&/@((ap hr Norm[diff] Base3D) . {temp,Normalize[Cross[temp,diff]]}),2,1]]}}]
] /; Length[from]==Length[to]==3


Arrow[a_, Tail->b_, opts___] := Vector[b,a+b,opts]

Arrow[a_, opts___] := Vector[Table[0,{Length[a]}],a,opts]

ArrowHead[a_, b_, opts___] := Vector[a-b,a,ShaftQ->False,opts]

End[];

EndPackage[];
Null

VectorField and Phase Lines

(*  :Title: VectorAndPhase.m  *)

(*  :Author:  Bill Davis  *)

(*  :Dates:  about March, 1996 *)

(*  :Drawbacks:  I wish someone serious would come and turn these into
                 Really carefully done packages.  *)

BeginPackage["PhaseStuff`","Vector3D`",
		"Utilities`FilterOptions`"];

PhaseLine::usage = "PhaseLine[fcn,{var,a,b},tint,pos]
	makes a vertical phase line for the function, fcn, of the variable, var,
	for the variable going from a to b, with 
	a color given by tint,  at the x-coordinate pos.";
	
PhaseLine3D::usage = "PhaseLIne3D[fcn,{var,a,b},tint,loc]
	makes a vertical phase line for the function, fcn, of the variable, var,
	for the variable going from a to b, with 
	a color given by tint, and base point at loc = {x,y}";
	
VectorField::usage = "VectorField[{function,{var1,a,b,space1},{var2,c,d,space2}]
	will make a vector field of normalized vectors, colored by
	magnitude, for the function of the variables on the
	range {r1,r2} with spacing between points given by 
	{space1, space2}.  If a single function of a single variable is given,
	the vector field {1,f} will be plotted.";
	
StikPikXZ::usage = "StikPikXZ[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
StikPikYZ::usage = "StikPikYZ[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
StikPikXY::usage = "StikPikXY[picture,a:_0] takes a 2 dimensional
	Mathematica picture and embeds it on the XZ plane at y = a.  
	Some optional characteristics of the graphs are lost in the 
	process.  StikPikYZ and StikPikXZ are similar.";
	
Begin["`Private`"];	

PhaseLine[fcn_,{var_,a_,b_},tint_,pos_:0] := 
	Module[{len,len1,k,zset,zero,zero1,signs,stick,dots,pointers},
	zset = Solve[fcn==0,var];
	zero = If[Length[zset]==0,{},var/.zset];
	zero = Sort[zero];
	zero = Select[zero,((# >= a)&&(# <= b))&];
	zero1 = Sort[Union[zero,{a,b}]];
	len = Length[zero];
	len1 = Length[zero1];
	signs = Table[Sign[fcn/.var->((zero1[[k+1]] + zero1[[k]])/2)],
		{k,1,len1-1}];
	stick = {Thickness[0.007],Line[{{pos,a},{pos,b}}]};
	dots = Point[{pos,#}]&/@zero;
	dots = Join[{PointSize[0.05],tint},dots];
	heads = Table[MakeHead[zero1[[k]],zero1[[k+1]],pos,
		signs[[k]],b-a,tint],{k,1,len1-1}];
	Return[{Graphics[Join[{tint},stick,dots]],heads}]
		]
		
MakeHead[a_,b_,c_,s_,slen_,tint_] := Module[{u,v,w},
	u = Min[2(b-a),3/4 slen];
	Return[ArrowHead[{c,a(.5-s/5)+b(.5+s/5)},
		{0,s u},VectorColor->tint]]]
		
PhaseLine3D[fcn_,{var_,a_,b_},tint_,pos_:{0,0}] := 
	Module[{len,len1,k,zset,zero,zero1,signs,stick,dots,pointers},
	zset = Solve[fcn==0,var];
	zero = If[Length[zset]==0,{},var/.zset];
	zero = Sort[zero];
	zero = Select[zero,((# >= a)&&(# <= b))&];
	zero1 = Sort[Union[zero,{a,b}]];
	len = Length[zero];
	len1 = Length[zero1];
	signs = Table[Sign[fcn/.var->((zero1[[k+1]] + zero1[[k]])/2)],
		{k,1,len1-1}];
	stick = {Thickness[0.007],Line[{{pos[[1]],pos[[2]],a},
		{pos[[1]],pos[[2]],b}}]};
	dots = Point[{pos[[1]],pos[[2]],#}]&/@zero;
	dots = Join[{PointSize[0.03],tint},dots];
	heads = Table[MakeHead3D[zero1[[k]],zero1[[k+1]],pos,
		signs[[k]],b-a,tint],{k,1,len1-1}];
	Return[{Graphics3D[Join[{tint},stick,dots]],heads}]
		]
		
MakeHead3D[a_,b_,c_,s_,slen_,tint_] := Module[{u,v,w},
	u = Min[2(b-a),1/2 slen];
	Return[ArrowHead[{c[[1]],c[[2]],a(.5-s/5)+b(.5+s/5)},
		{0,0,s u},VectorColor->tint]]]
		
		
VectorField[function_List,{var1_,a_,b_,sp1_:1},{var2_,c_,d_,sp2_:1}] := 
	Module[{i,j,U,V,UU,VV,ulow,uhigh,vlow,vhigh,maxval,minval,
		lengths,directions,locations,mlen},
	mlen = Min[sp1,sp2];
	normf[uu_,vv_] = Sqrt[function[[1]]^2+function[[2]]^2]/.
		{var1->uu,var2->vv};
	lengths = Table[N[normf[U,V]],{U,a,b,sp1},{V,c,d,sp2}];
	maxval = Max[lengths]; minval = Min[lengths];
	If[minval == maxval,maxval += 1];
	locations = Table[{uu,vv},{uu,a,b,sp1},
		{vv,c,d,sp2}];
	directions = Table[If[N[normf[U,V]]==0,{0,0},
		mlen (function/.{var1->U,var2->V})/(1.3 N[normf[U,V]])],
			{U,a,b,sp1},{V,c,d,sp2}];
	{UU,VV} = Dimensions[directions][[{1,2}]];
	Return[Table[Arrow[directions[[i,j]],
			Tail->locations[[i,j]],Aperture->1,
			HeadRatio->.4,ShaftWidth->0.008, VectorColor->
			RGBColor[(lengths[[i,j]] - minval)/(maxval-minval),0,
				(maxval -lengths[[i,j]])/(maxval-minval)]],{i,UU},{j,VV}]]
		]
		
VectorField[function_,{var1_,a_,b_,sp1_:1},{var2_,c_,d_,sp2_:1}] :=
	VectorField[{1,function},{var1,a,b,sp1},{var2,c,d,sp2}]
	
	
Needs["Utilities`FilterOptions`"]

FixOptions[a_] := Module[{picture = a, opt3},
If[Options[picture] != {}, 
	opt3 = FilterOptions[Graphics3D,#]&/@Options[picture];
	(* Fix things that might carry 2D characteristics. *)
	opt3 = opt3//. {(AxesLabel -> _) ->(AxesLabel -> None),
			(PlotRange->_) -> (PlotRange->Automatic),
			(PlotRegion -> _) -> (PlotRegion -> Automatic),
			(Ticks -> _) -> (Ticks -> Automatic)};
	picture = Apply[List,picture];
	picture[[-1]] = opt3;
	picture = Apply[Graphics3D,picture]];
	Return[picture]
	]

StikPikXZ[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{u,a,v}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]


StikPikYZ[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{a,u,v}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]


StikPikXY[picture_,a_:0] := Module[{PIK3 = picture},
	PIK3 = PIK3//.{Graphics->Graphics3D,
		{u_?NumberQ,v_?NumberQ}:>{u,v,a}};
	PIK3 = FixOptions[PIK3];
	Return[PIK3]
		]
		
End[];

EndPackage[];
Null

ThreeAxes[u,v]

ThreeAxes[u_,v_] := 
      Graphics3D[{
            {Blue,Line[{{-u,0,0},{u,0,0}}]},
                    Text["x",{u + v,0,0}],
            {Blue,Line[{{0,-u,0},{0,u,0}}]},
                    Text["y",{0, u + v,0}],
            {Blue,Line[{{0,0,0},{0,0,u}}]},
                    Text["z",{0,0,u + v}]}]; 
ThreeAxes[u_] := ThreeAxes[u,u/8];
ThreeAxes::usage = "ThreeAxes[a,b] makes a standard cartesian axis graphics object
	with x, y, and z running from -a to a, and with axis
	labels b units beyond the tips of the axes.  ThreeAxes[a]
	is ThreeAxes[a,a/8].";

Crisscross

Clear[x];
crisscross = Plot[{Cos[x],Sin[x]},{x,Pi/8,3 Pi/8},
    PlotStyle->{{RGBColor[1,0,0],Thickness[0.02]}},
    Axes->None,AspectRatio->1/3,
    DisplayFunction->Identity];

T.1)  The exponential diffeq and your personal finances

You deposit $K in a savings account bearing interest rate 100 x percent per year compounded every instant.  This means that if balance[t] is the value in dollars of this untouched savings account at time t years after the deposit, then
       balance[t] = K (e^(x t)) .

T.1.a.i)

What differential equation does balance[t] solve?

balance'[t]=K (e^(x t)) x 
        = balance[t] x 
        = x balance[t]; 
so balance[t] solves the unforced exponential differential equation
       balance'[t]-x balance[t]=0.
       with balance[0] = K. 
See the balance grow over a ten year period in this sample case of an initial deposit of K = $2000 with interest rate 100  x = 4  %.

\(Clear[balance, t]; 
K = 2000; 
x = 0.04; 

    balance[t_] = K\ E\^\(x\ t\)\)\(endtime = 10; 

    Plot[balance[t], {t, 0, endtime}, 
      PlotStyle -> {{Thickness[0.01], DarkGreen}}, 
      AxesLabel -> {"t", "bal[t]"}, 
      AspectRatio -> 1\/GoldenRatio]; \)

See what happens over a 30 year period:

endtime = 30; 
    Plot[balance[t], {t, 0, endtime}, 
      PlotStyle -> {{Thickness[0.01], DarkGreen}}, 
      AxesLabel -> {"t", "bal[t]"}, 
      AspectRatio -> (1/GoldenRatio)];

T.1.a.ii)

At the time of your original deposit of $K, you arrange with your bank to make a continuous deposit into your account at a rate of d dollars per year.  This means that after t years,
          t d additional dollars
have been deposited.  As the new money is deposited into the account, the new money begins to earn interest at the rate of 100 x percent compounded every instant. 
If balance[t] is the amount in the account t years after the arrangement was set up, then what differential equation does balance[t] satisfy and what is a formula for its solution?

The differential equation is
       balance'[t] = x balance[t] +  d
with
       balance[0] = P.

This diffeq is the forced exponential diffeq
       balance'[t] - x balance[t] =   d
with
       balance[0] = K.
       A formula for its solution is:

\(Clear[balance, f, K, x, d, t]; 
starter = K; 
r = \(-x\); 

    f[t_] = d; 

    balance[t_] = 
      Expand[E\^\(\(-r\)\ t\)\ starter + 
          E\^\(\(-r\)\ t\)\ 
            \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\)]
        \)

T.1.a.iii)

Plot balance[t] over the first 10 years for the case in which
       K = $5000, 
       d = $500, 
       100 x % = 5.3  % compounded every instant.

It's a snap:
The diffeq is
        balance'[t] - x balance[t] =   d
with
       balance[0] = K.
 Here's the formula for balance[t]:

\(Clear[balance, f, K, x, d, t]; 
endtime = 10; 
K = 5000; 

    starter = K; 
d = 500; 
x = 0.053; 
r = \(-x\); 
f[t_] = d; 

    balance[t_] = 
      Expand[E\^\(\(-r\)\ t\)\ starter + 
          E\^\(\(-r\)\ t\)\ 
            \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\)]
        \)

Here comes the plot:

endtime = 10; plot = 
      Plot[balance[t], {t, 0, endtime}, 
        PlotStyle -> {{Blue, Thickness[0.01]}}, 
        AspectRatio -> (1/GoldenRatio), 
        AxesLabel -> {"t", "$"}];

Better than $14, 000 in 10 years.

T.1.b)

You and your significant other have just had a beautiful bouncing baby. You can already tell that the kid is as smart as all get-out, and you decide to set up a bank account geared toward producing big-time college money in 18 years. 
You can come up with $10, 000 for the account now and you can lock in an interest rate of
       100 r % = 4.6  % compounded every instant. 
How do you set your yearly payment rate d (to result in $t d after t years) to be sure of having $120, 000 dollars in your account by the end of 18 years?

Thanks to the magic of differential equations, coming up with the answer is a piece of cake.
The diffeq is:
       balance'[t]+0.046 balance[t]=d
witth balance[0] = 10000.
Go with a cleared d to get a formula for balance[t]:

\(Clear[balance, f, K, x, d, t]; 
K = 10000; 
starter = K; 
x = 0.046; 
    
r = \(-x\); 
f[t_] = d; 
    balance[t_] = 
      Expand[E\^\(\(-r\)\ t\)\ starter + 
          E\^\(\(-r\)\ t\)\ 
            \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\)]
        \)

After 18 years, the balance is:

balance[18]

You want balance[18] = 120000:

Solve[balance[18] == 120000, d]

You will need to put in about $3500 per year into the college account.
See it grow:

d = 3467; endtime = 18; plot = 
      Plot[balance[t], {t, 0, endtime}, 
        PlotStyle -> {{Blue, Thickness[0.01]}}, 
        AspectRatio -> (1/GoldenRatio), 
        AxesLabel -> {"t", "$"}];

There you go.
If you have a good job, this is a rather painless way of coming up with tuition, room and board.

T.2)  The jump function UnitStep[t - d] and the impulse function DiracDelta[t - d]

T.2.a.i)

Here is a plot of the jump function UnitStep[t - d] for d = 2.5:

d = 2.5\(Clear[t]; 

    Plot[UnitStep[t - d], {t, 0, 4}, 
      PlotStyle -> {{Thickness[0.01], MarsOrange}}, 
      AspectRatio -> 1\/2, 
      AxesLabel -> {"t", "UnitStep[t - d]"}, 
      Epilog -> {Red, Text["d", {d, \(-0.1\)}]}]; \)

Here is a plot of the jump function UnitStep[t - d] for a random d:

d = Random[Real, {1, 3}]Plot[UnitStep[t - d], {t, 0, 4}, 
      PlotStyle -> {{Thickness[0.01], MarsOrange}}, 
      AspectRatio -> (1/2), 
      AxesLabel -> {"t", "UnitStep[t - d]"}, 
      Epilog -> {Red, Text["d", {d, -0.08}]}];

Describe how UnitStep[t - d] plots out.

Take another look:

d = Random[Real, {1, 3}]Plot[UnitStep[t - d], {t, 0, 4}, 
      PlotStyle -> {{Thickness[0.01], Blue}}, AspectRatio -> (1/2), 
      AxesLabel -> {"t", "UnitStep[t - d]"}, 
      Epilog -> {Red, Text["d", {d, -0.08}]}];

UnitStep[t - d] plots out so that:
         UnitStep[t - d] = 0 for t < d
and
         UnitStep[t - d] = 1 for t > d.
At  t = d, 
         UnitStep[t - d] jumps from 0 to 1.

T.2.a.ii) The impulse DiracDelta [t - d is the derivative of UnitStep[t - d]

Here is Mathematica's calculation of the derivative of 
       UnitStep[t - d]:

Clear[f, t, d];
f[t_] = UnitStep[t - d];
f'[t]

What does this tell you about DiracDelta[t - d] for t not equal to d?

Remember:
         UnitStep[t - d] = 0 for t < d
and
         UnitStep[t - d] = 1 for t > d.
So (∂_t) UnitStep[t - d] = 0 for all t's not equal to d.
Consequently:
         DiracDelta[t - d] = (∂_t) UnitStep[t - d] = 0 
 for all t's not equal to d.

T.2.b.i) Integrating DiracDelta[t - d]

Look at these experiments:

\(Clear[t, d]; 

    ∫\_\(-∞\)\%∞ DiracDelta[t - d] 
        \[DifferentialD]t\)

h = 2; (∫_(d - h)^(d + h))DiracDelta[t - d] 
        \[DifferentialD]t

h = 1; (∫_(d - h)^(d + h))DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.1; (∫_(d - h)^(d + h))DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.00001; (∫_(d - h)^(d + h))DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.00001; (∫_(-∞)^(d - h))DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.00001; (∫_(d + h)^∞) DiracDelta[t - d] 
        \[DifferentialD]t

Interpret these experiments.

Even though DiracDelta[t - d] = 0 for t not equal to d, when you 
→ integrate DiracDelta[t - d] over any interval containing d, you get 1.
→ integrate DiracDelta[t - d] over any interval not containing d, you get 0.

Lots of folks like to say that  
       DiracDelta[d - d] = DiracDelta[0]
spikes at 0 to a certain order of infinity that makes all this work.

T.2.b.ii) Integrals involving DiracDelta[t - d] are easy to do by hand

Look at these experiments:

\(Clear[t, f, d]; 

    ∫\_\(-∞\)\%∞\( f[t]\ DiracDelta[t - d]\) 
        \[DifferentialD]t\)

h = 2; (∫_(d - h)^(d + h))f[t] DiracDelta[t - d] 
        \[DifferentialD]t

h = 1; (∫_(d - h)^(d + h))f[t] DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.1; (∫_(d - h)^(d + h))f[t] DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.00001; (∫_(d - h)^(d + h))f[t] DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.00001; (∫_(-∞)^(d - h))f[t] DiracDelta[t - d] 
        \[DifferentialD]t

h = 0.00001; (∫_(d + h)^∞) f[t] DiracDelta[t - d] 
        \[DifferentialD]t

Interpret these experiments.

Even though DiracDelta[t - d] = 0 for t not equal to d, when you 
→ integrate f[t] DiracDelta[t - d] over any interval containing d, you get f[d].
→ integrate f[t] DiracDelta[t - d] over any interval not containing d, you get 0.

It seems that DiracDelta[d - d] = DiracDelta[0] spikes to a certain order of infinity that makes all this work.

T.2  .b.iii) DiracDelta[t - d] isn't a normal function

Give a short history of DiracDelta[t - d].

Nobel prize winning physicist Paul Dirac developed what is now called the Dirac delta function a little more than fifty years ago.  Scientists immediately put the Dirac delta function to use and got good results, but mathematicians objected because there was no firm mathematical foundation for the Dirac delta function. 

Luckily for science, the French mathematician, Laurent Schwartz, pulled off a 20th Century mathematical miracle by creating an extended theory of functions.  Schwartz's theory includes all functions that are functions in the normal sense of the word "function" and Scwartz's theory includes additional "functions" which some advanced folks call by the name "distributions." 

DiracDelta[t - d] is in this class of additional  "functions.". 

You are invited to use and enjoy this mathematical beauty with confidence and authority.

T.3) Impulse-forcing the exponential diffeq with a DiracDelta function: 
The physical meaning of the impulse  hit

Old hands at diffeq know that you can get a formula for the solution of the forced exponential diffeq
       y'[t]  +  r y[t]  =  f[t], with y[0] = starter.
The formula is:
       y[t] =  (E^(-r t)) starter +   (E^(-r t))(∫_0^t) (E^(r t)) f[t] dt . 
Here is the formula at work on 
       y'[t]+0.45  y[t]=8 DiracDelta[t  -  4], with y[0] = 9.0.:

\(Clear[yformula, f, t]; 
f[t_] = 8\ DiracDelta[t - 4]; r = 0.45; 
    starter = 9.0; 
    yformula[t_] = 
      E\^\(\(-r\)\ t\)\ starter + 
        E\^\(\(-r\)\ t\)\ 
          \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\)\)

See it:

\(endtime = 12; 

    solutionplot = 
      Plot[yformula[t], {t, 0, endtime}, 
        PlotStyle -> {{CadmiumOrange, Thickness[0.01]}}, 
        AxesLabel -> {"t", "y[t]"}, PlotRange -> All, 
        AspectRatio -> 1\/GoldenRatio]; \)

Describe what you see and explain why you see it.

Look at this embellished picture

\(tail = {6, 10}; 

    label = Graphics[{
          Text["Impulse hit 
 with DiracDelta[t - 4]", tail]}]; 
    pointer = 
      Arrow[{4, yformula[3.9999]} - tail, Tail -> tail, 
        HeadSize -> 1]; Show[solutionplot, label, pointer]\)

8 DiracDelta[t - 4] fired at t = 4 and jumped y[t] a whole 8 units up at t = 4:

yformula[4.00000001] - yformula[3.9999999]

That's the effect of forcing the exponential diffeq with a DiracDelta function.
You can see why this happens by looking at
       yformula[t]  =  
        (E^(-r t)) starter +  
          (E^(-r t)) 
            (∫_0^t) (E^(r t)) 8 DiracDelta[t  -  4] 
                dt.

For 0 ≤ t < 4, DiracDelta[t - 4] = 0, 
so if t < 4, then
       yformula[t]  =  
        (E^(-r t)) starter +  
          (E^(-r t)) 
            (∫_0^t) (E^(r t)) 8 DiracDelta[t  -  4] 
                dt.
                         (( = E)^(-r t)) starter  +  
        (E^(-r t)) 
          (∫_0^t) (E^(r t)) 0 dt
                         (( = E)^(-r t)) starter  + 0
                         (( = E)^(-r t)) starter
  
                        
For t > 4, then DiracDelta[t - 4] fires at t = 4 and
      yformula[t]  =  
        (E^(-r t)) starter +  
          (E^(-r t)) 
            (∫_0^t) (E^(r t)) 8 DiracDelta[t  -  4] 
                dt.
                        (( =  E)^(-r t)) starter + 
        (E^(-r t)) 8 (E^(r 4)) 
                        (( =  E)^(-r t)) starter + 8  (E^(-r (t - 4))) 
      
So as t advances through t = 4, yformula[t] jumps from
       (E^(-r 4)) starter 
to
       (E^(-r 4)) starter + 8  (E^(-r (4 - 4)))   =  
        (E^(-r 4)) starter  +  8.
This is a jump up of length 8.

T.4) The DiracDelta function in your personal finances

T.4.a)

You deposit $7500 into an account paying 5.6  % interest over 10 years. You plan to make an annual additional deposit of $8000 at the end of each of the 10 years. The same interest rate of 5.6  % is guaranteed over the 10 year period.
Use the DiracDelta function to help you to plot the projected status of your account:

The diffeq is
       balance'[t]-0.056 balance[t]=(∑_(k = 1)^10) d DiracDelta[t - k]
with
       balance[0] = K.
 Here's the formula for balance[t]:

\(Clear[balance, f, K, x, d, t]; 
endtime = 10; 
K = 7500; 

    starter = K; 
d = 8000; 
r = \(-0.056\); 


    f[t_] = ∑\+\(k = 1\)\%10 d\ DiracDelta[t - k]; 

    balance[t_] = 
      Expand[E\^\(\(-r\)\ t\)\ starter + 
          E\^\(\(-r\)\ t\)\ 
            \(∫\_0\%t\( E\^\(r\ t\)\ f[t]\) \[DifferentialD]t\)]
        \)

Here comes the plot:

endtime = 10; plot = 
      Plot[balance[t], {t, 0, endtime}, 
        PlotStyle -> {{DarkGreen, Thickness[0.01]}}, 
        AspectRatio -> (1/GoldenRatio), 
        AxesLabel -> {"t", "$"}];

Better than $100, 000 in 10 years.