#set document(title: "1.1 Integrals as solutions", author: "Jiří Lebl") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 1.1#h(0.6em)Integrals as solutions A first order ODE is an equation of the form #math.equation(block: true, alt: "the fraction d y over d x equals f open parenthesis x , y close parenthesis")[$frac(d y, d x) = f ( x , y )$] or just #math.equation(block: true, alt: "y prime equals f open parenthesis x , y close parenthesis")[$y^(′) = f ( x , y )$] In general, there is no simple formula or procedure one can follow to find solutions. In the next few lectures we will look at special cases where solutions are not difficult to obtain. In this section, let us assume that #math.equation(block: false, alt: "f")[$f$] is a function of #math.equation(block: false, alt: "x")[$x$] alone, that is, the equation is #math.equation(block: true, alt: "y prime equals f open parenthesis x close parenthesis")[$y^(′) = f ( x )$] We could just integrate (antidifferentiate) both sides with respect to #math.equation(block: false, alt: "x")[$x$]. #math.equation(block: true, alt: "∫ y prime open parenthesis x close parenthesis d x equals ∫ f open parenthesis x close parenthesis d x plus C")[$∫ y^(′) ( x ) d x = ∫ f ( x ) d x + C$] that is #math.equation(block: true, alt: "y open parenthesis x close parenthesis equals ∫ f open parenthesis x close parenthesis d x plus C")[$y ( x ) = ∫ f ( x ) d x + C$] This #math.equation(block: false, alt: "y open parenthesis x close parenthesis")[$y ( x )$] is actually the general solution. So to solve Equation (1.1.1), we find some antiderivative of #math.equation(block: false, alt: "f open parenthesis x close parenthesis")[$f ( x )$] and then we add an arbitrary constant to get the general solution. Now is a good time to discuss a point about calculus notation and terminology. Calculus textbooks muddy the waters by talking about the integral as primarily the so-called #strong[indefinite integral]. The indefinite integral is really the #strong[antiderivative] (in fact the whole one-parameter family of antiderivatives). There really exists only one integral and that is the definite integral. The only reason for the indefinite integral notation is that we can always write an antiderivative as a (definite) integral. That is, by the fundamental theorem of calculus we can always write #math.equation(block: false, alt: "∫ f open parenthesis x close parenthesis d x plus C")[$∫ f ( x ) d x + C$] as #math.equation(block: true, alt: "∫ x sub 0 x f open parenthesis t close parenthesis d t plus C")[$∫_(x_(0))^(x) f ( t ) d t + C$] Hence the terminology to integrate when we may really mean to antidifferentiate. Integration is just one way to compute the antiderivative (and it is a way that always works, see the following examples). Integration is defined as the area under the graph, it only happens to also compute antiderivatives. For sake of consistency, we will keep using the indefinite integral notation when we want an antiderivative, and you should always think of the definite integral. #examplebox("Example 1")[][ Find the general solution of #math.equation(block: false, alt: "y prime equals 3 x squared")[$y^(′) = 3 x^(2)$]. #solutionbox[ Elementary calculus tells us that the general solution must be #math.equation(block: false, alt: "y equals x cubed plus C")[$y = x^(3) + C$]. Let us check: #math.equation(block: false, alt: "y prime equals 3 x squared")[$y^(′) = 3 x^(2)$]. We have gotten precisely our equation back. Normally, we also have an initial condition such as #math.equation(block: false, alt: "y open parenthesis x sub 0 close parenthesis equals y sub 0")[$y ( x_(0) ) = y_(0)$] for some two numbers#math.equation(block: false, alt: "x sub 0")[$x_(0)$] and #math.equation(block: false, alt: "y sub 0")[$y_(0)$] #math.equation(block: false, alt: "x sub 0")[$x_(0)$] is usually 0, but not always). We can then write the solution as a definite integral in a nice way. Suppose our problem is #math.equation(block: false, alt: "y prime equals f open parenthesis x close parenthesis , y open parenthesis x sub 0 close parenthesis equals y sub 0")[$y^(′) = f ( x ) , y ( x_(0) ) = y_(0)$]. Then the solution is #math.equation(block: true, alt: "y open parenthesis x close parenthesis equals ∫ x sub 0 x f open parenthesis s close parenthesis d s plus y sub 0")[$y ( x ) = ∫_(x_(0))^(x) f ( s ) d s + y_(0)$] Let us check! We compute #math.equation(block: false, alt: "y prime equals f open parenthesis x close parenthesis")[$y^(′) = f ( x )$], via the fundamental theorem of calculus, and by Jupiter, #math.equation(block: false, alt: "y")[$y$] is a solution. Is it the one satisfying the initial condition? Well, #math.equation(block: false, alt: "y open parenthesis x sub 0 close parenthesis equals ∫ x sub 0 x sub 0 f open parenthesis x close parenthesis d x plus y sub 0 equals y sub 0")[$y ( x_(0) ) = ∫_(x_(0))^(x_(0)) f ( x ) d x + y_(0) = y_(0)$]. It is! Do note that the definite integral and the indefinite integral (antidifferentiation) are completely different beasts. The definite integral always evaluates to a number. Therefore, Equation (1.1.2) is a formula we can plug into the calculator or a computer, and it will be happy to calculate specific values for us. We will easily be able to plot the solution and work with it just like with any other function. It is not so crucial to always find a closed form for the antiderivative. ] ] #examplebox("Example 2")[][ Solve #math.equation(block: true, alt: "y prime equals e to the power minus x squared , y open parenthesis 0 close parenthesis equals 1 .")[$y^(′) = e^(− x^(2)) , " " " " y ( 0 ) = 1 .$] By the preceding discussion, the solution must be #math.equation(block: true, alt: "y open parenthesis x close parenthesis equals ∫ 0 x e to the power minus s squared d s plus 1 .")[$y ( x ) = ∫_(0)^(x) e^(− s^(2)) d s + 1 .$] #solutionbox[ Here is a good way to make fun of your friends taking second semester calculus. Tell them to find the closed form solution. Ha ha ha (bad math joke). It is not possible (in closed form). There is absolutely nothing wrong with writing the solution as a definite integral. This particular integral is in fact very important in statistics. Using this method, we can also solve equations of the form #math.equation(block: true, alt: "y prime equals f open parenthesis y close parenthesis")[$y^(′) = f ( y )$] Let us write the equation in Leibniz notation. #math.equation(block: true, alt: "the fraction d y over d x equals f open parenthesis y close parenthesis")[$frac(d y, d x) = f ( y )$] Now we use the inverse function theorem from calculus to switch the roles of #math.equation(block: false, alt: "x")[$x$] and #math.equation(block: false, alt: "y")[$y$] to obtain #math.equation(block: true, alt: "the fraction d y over d x equals the fraction 1 over f open parenthesis y close parenthesis")[$frac(d y, d x) = frac(1, f ( y ))$] What we are doing seems like algebra with #math.equation(block: false, alt: "d x")[$d x$] and #math.equation(block: false, alt: "d y")[$d y$]. It is tempting to just do algebra with #math.equation(block: false, alt: "d x")[$d x$] and #math.equation(block: false, alt: "d y")[$d y$] as if they were numbers. And in this case it does work. Be careful, however, as this sort of hand-waving calculation can lead to trouble, especially when more than one independent variable is involved. At this point we can simply integrate, #math.equation(block: true, alt: "x open parenthesis y close parenthesis equals ∫ the fraction 1 over f open parenthesis y close parenthesis d y plus C")[$x ( y ) = ∫ frac(1, f ( y )) d y + C$] Finally, we try to solve for #math.equation(block: false, alt: "y")[$y$]. ] ] #examplebox("Example 3")[][ Previously, we guessed #math.equation(block: false, alt: "y prime equals k y")[$y^(′) = k y$] (for some #math.equation(block: false, alt: "k greater than 0")[$k > 0$]) has the solution #math.equation(block: false, alt: "y equals C e to the power k x")[$y = C e^(k x)$]. We can now find the solution without guessing. First we note that #math.equation(block: false, alt: "y equals 0")[$y = 0$] is a solution. Henceforth, we assume #math.equation(block: false, alt: "y not equal to 0")[$y ≠ 0$]. We write #math.equation(block: true, alt: "the fraction d x over d y equals the fraction 1 over k y")[$frac(d x, d y) = frac(1, k y)$] We integrate to obtain #math.equation(block: true, alt: "x open parenthesis y close parenthesis equals x equals the fraction 1 over k ln | y | plus D")[$x ( y ) = x = frac(1, k) ln | y | + D$] where #math.equation(block: false, alt: "D")[$D$] is an arbitrary constant. Now we solve for#math.equation(block: false, alt: "y")[$y$] (actually for #math.equation(block: false, alt: "| y |")[$| y |$] ). #math.equation(block: true, alt: "| y | equals e to the power k x minus k D equals e to the power minus k D e to the power k x")[$| y | = e^(k x − k D) = e^(− k D) e^(k x)$] If we replace #math.equation(block: false, alt: "e to the power minus k D")[$e^(− k D)$] with an arbitrary constant #math.equation(block: false, alt: "C")[$C$] we can get rid of the absolute value bars (which we can do as #math.equation(block: false, alt: "D")[$D$] was arbitrary). In this way, we also incorporate the solution #math.equation(block: false, alt: "y equals 0")[$y = 0$]. We get the same general solution as we guessed before, #math.equation(block: false, alt: "y equals C e to the power k x")[$y = C e^(k x)$]. ] #examplebox("Example 4")[][ Find the general solution of #math.equation(block: false, alt: "y prime equals y squared")[$y^(′) = y^(2)$]. #solutionbox[ First we note that #math.equation(block: false, alt: "y equals 0")[$y = 0$] is a solution. We can now assume that #math.equation(block: false, alt: "y not equal to 0")[$y ≠ 0$]. Write #math.equation(block: true, alt: "the fraction d x over d y equals the fraction 1 over y squared")[$frac(d x, d y) = frac(1, y^(2))$] We integrate to get #math.equation(block: true, alt: "x equals the fraction minus 1 over y plus C")[$x = frac(− 1, y) + C$] We solve for #math.equation(block: false, alt: "y equals the fraction 1 over C minus x")[$y = frac(1, C − x)$]. So the general solution is #math.equation(block: true, alt: "y equals the fraction 1 over C minus x o r y equals 0")[$y = frac(1, C − x) o r y = 0$] Note the singularities of the solution. If for example #math.equation(block: false, alt: "C equals 1")[$C = 1$], then the solution as we approach #math.equation(block: false, alt: "x equals 1")[$x = 1$]. See Figure #math.equation(block: false, alt: "1")[$1$]. Generally, it is hard to tell from just looking at the equation itself how the solution is going to behave. The equation #math.equation(block: false, alt: "y prime equals y squared")[$y^(′) = y^(2)$] is very nice and defined everywhere, but the solution is only defined on some interval #math.equation(block: false, alt: "open parenthesis minus infinity , C close parenthesis")[$( − ∞ , C )$] or #math.equation(block: false, alt: "open parenthesis C , infinity close parenthesis")[$( C , ∞ )$]. Usually when this happens we only consider one of these the solution. For example if we impose a condition #math.equation(block: false, alt: "y open parenthesis 0 close parenthesis equals 1")[$y ( 0 ) = 1$], then the solution is #math.equation(block: false, alt: "y equals the fraction 1 over 1 minus x")[$y = frac(1, 1 − x)$], and we would consider this solution only for #math.equation(block: false, alt: "x")[$x$] on the interval #math.equation(block: false, alt: "open parenthesis minus infinity , 1 close parenthesis")[$( − ∞ , 1 )$]. In the figure, it is the left side of the graph. #figure(figph[Plot of a curve on axes from -3 to 3 with a vertical asymptote at x = 1: the left branch rises off the top of the frame, the right comes up from below and flattens toward about -0.5.], alt: "Plot of a curve on axes from -3 to 3 with a vertical asymptote at x = 1: the left branch rises off the top of the frame, the right comes up from below and flattens toward about -0.5.", caption: [Figure #math.equation(block: false, alt: "1")[$1$]: Plot of #math.equation(block: false, alt: "y equals the fraction 1 over 1 minus x")[$y = frac(1, 1 − x)$].]) ] ] Classical problems leading to differential equations solvable by integration are problems dealing with velocity, acceleration and distance. You have surely seen these problems before in your calculus class. #examplebox("Example 5")[][ Suppose a car drives at a speed #math.equation(block: false, alt: "e to the power t / 2")[$e^(t / 2)$] meters per second, where #math.equation(block: false, alt: "t")[$t$] is time in seconds. How far did the car get in 2 seconds (starting at #math.equation(block: false, alt: "t equals 0")[$t = 0$])? How far in 10 seconds? #solutionbox[ Let #math.equation(block: false, alt: "x")[$x$] denote the distance the car traveled. The equation is #math.equation(block: true, alt: "x prime equals e to the power t / 2")[$x^(′) = e^(t / 2)$] We can just integrate this equation to get that #math.equation(block: true, alt: "x open parenthesis t close parenthesis equals 2 e to the power t / 2 plus C")[$x ( t ) = 2 e^(t / 2) + C$] We still need to figure out #math.equation(block: false, alt: "C")[$C$]. We know that when #math.equation(block: false, alt: "t equals 0")[$t = 0$], then #math.equation(block: false, alt: "x equals 0")[$x = 0$]. That is, #math.equation(block: false, alt: "x open parenthesis 0 close parenthesis equals 0")[$x ( 0 ) = 0$]. So #math.equation(block: true, alt: "0 equals x open parenthesis 0 close parenthesis equals 2 e to the power 0 / 2 plus C equals 2 plus C")[$0 = x ( 0 ) = 2 e^(0 / 2) + C = 2 + C$] Thus #math.equation(block: false, alt: "C equals minus 2")[$C = − 2$] and #math.equation(block: true, alt: "x open parenthesis t close parenthesis equals 2 e to the power t / 2 minus 2")[$x ( t ) = 2 e^(t / 2) − 2$] Now we just plug in to get where the car is at 2 and at 10 seconds. We obtain #math.equation(block: true, alt: "x open parenthesis 2 close parenthesis equals 2 e to the power 2 / 2 minus 2 approximately equals 3.44 ~meters , x open parenthesis 10 close parenthesis equals 2 e to the power 10 / 2 minus 2 approximately equals 294 ~meters")[$x ( 2 ) = 2 e^(2 / 2) − 2 ≈ 3.44 "~meters" , " " " " " " x ( 10 ) = 2 e^(10 / 2) − 2 ≈ 294 "~meters"$] ] ] #examplebox("Example 6")[][ Suppose that the car accelerates at a rate of #math.equation(block: false, alt: "t squared the fraction m over s squared")[$t^(2) frac(m, s^(2))$]. At time #math.equation(block: false, alt: "t equals 0")[$t = 0$] the car is at the 1 meter mark and is traveling at 10 #super[m]/#sub[s]. Where is the car at time #math.equation(block: false, alt: "t equals 10")[$t = 10$]. #solutionbox[ Well this is actually a second order problem. If #math.equation(block: false, alt: "x")[$x$] is the distance traveled, then #math.equation(block: false, alt: "x prime")[$x^(′)$] is the velocity, and #math.equation(block: false, alt: "x double prime")[$x^(″)$] is the acceleration. The equation with initial conditions is #math.equation(block: true, alt: "x double prime equals t squared , x open parenthesis 0 close parenthesis equals 1 , x prime open parenthesis 0 close parenthesis equals 10")[$x^(″) = t^(2) , #h(1em) x ( 0 ) = 1 , #h(1em) x^(′) ( 0 ) = 10$] What if we say #math.equation(block: false, alt: "x prime equals v")[$x^(′) = v$]. Then we have the problem #math.equation(block: true, alt: "v prime equals t squared , v open parenthesis 0 close parenthesis equals 10")[$v^(′) = t^(2) , #h(1em) v ( 0 ) = 10$] Once we solve for #math.equation(block: false, alt: "v")[$v$], we can integrate and find #math.equation(block: false, alt: "x")[$x$]. ] ]