Differential Equations

Differential Equations

Equations in which rates and derivatives are mentioned. We use the operator \(L\) in such equations.


Reference Function

A reference function is one not directly involved in the differentiability of an equation.


Classifications of Differential Equations

1. By Type

  • Ordinary Differential Equation (ODE): involves derivatives with respect to a single independent variable.
  • Partial Differential Equation (PDE): involves partial derivatives (i.e., with respect to multiple independent variables).

2. By Order

  • Refers to the highest derivative in the equation.
  • Note: This is not the same as the degree (which refers to the power of the highest derivative term).

3. By Linearity

  • A differential equation is linear if it is of the form:

    \[ a_n(x)\frac{d^n y}{dx^n} + a_{n-1}(x)\frac{d^{n-1} y}{dx^{n-1}} + \cdots + a_1(x)\frac{dy}{dx} + a_0(x)y = g(x) \]

  • Linearity conditions:

    • The dependent variable \(y\) and all its derivatives \(y', y'', \ldots, y^{(n)}\) are of first degree (i.e., raised to the power of 1).
    • The coefficients \(a_0(x), a_1(x), \ldots, a_n(x)\) depend only on the independent variable \(x\) (or are constants).
    • The term \(g(x)\) depends only on the independent variable \(x\) (or is a constant).
    • No products of \(y\) or its derivatives (e.g., \(y \cdot y'\) or \((y'')^2\)).

Notation

  • Leibniz Notation: \[ \frac{dy}{dx} \]

  • Newton Notation: \[ y' \]


Solutions of Differential Equations

General Solutions

  • A general solution contains arbitrary constants (e.g., \(C_1, C_2\)).
  • Particular solutions are derived from the general solution by assigning specific values to these constants, usually determined by initial or boundary conditions. Hence, there are infinitely many particular solutions.

Initial Value Problem (IVP)

  • A differential equation where the conditions are specified at a single point (i.e., a specific value of the independent variable). For an \(n\)-th order ODE, \(n\) conditions are given at the same point \(x_0\).

Boundary Value Problem (BVP)

  • A differential equation where the conditions are specified at two or more different points (boundaries) of the independent variable. For example, conditions might be given at \(x=a\) and \(x=b\).

Normal Form

The general form of an \(n\)-th order differential equation, solved for the highest derivative:

\[ \frac{d^n y}{dx^n} = f(x, y, y', \dots, y^{(n-1)}) \]

Family of Curves

  • The solution curves for a general solution form a family, with each curve corresponding to a different combination of the arbitrary constants.

First Order Differential Equations

Given a first-order differential equation:

\[ \frac{dy}{dx} = f(x, y) \]

This represents the slope of the tangent line to the solution curve at each point \((x, y)\).

Slope Conditions:

  • \((\frac{dy}{dx} > 0)\): The function \(y(x)\) is increasing.
  • \((\frac{dy}{dx} < 0)\): The function \(y(x)\) is decreasing.
  • \((\frac{dy}{dx} = 0)\): The function \(y(x)\) has a local extremum or a horizontal tangent; these points are often called equilibrium points or critical points.

At an equilibrium point: \[ \frac{dy}{dx} = 0 \Rightarrow y = \text{constant} \]

(if \(f\) depends only on \(y\))


Autonomous First-Order Equations

An autonomous first-order differential equation is of the form:

\[ \frac{dy}{dx} = f(y) \]

  • The derivative depends only on the dependent variable \(y\), not directly on the independent variable \(x\).
  • By finding the zeros of the function \(f(y)\) (i.e., \(f(y)=0\)), we can determine:
    • Equilibrium points (constant solutions)
    • Intervals where \(y(x)\) is increasing (\(f(y)>0\))
    • Intervals where \(y(x)\) is decreasing (\(f(y)<0\))

Solution Methods for First-Order Differential Equations

1. Solution by Direct Integration (Separable Equations)

A first-order ODE is separable if it can be written in the form \(dy/dx = G(x)H(y)\), or equivalently: \[ M(x)dx + N(y)dy = 0 \] where the variables can be separated.

Fundamental Theorem of Calculus (as applied to solutions): If \(\frac{dy}{dx} = g(x)\), then the solution is given by: \[ y(x) = y_0 + \int_{x_0}^{x} g(t)\,dt \]

This is a separable differential equation. We can solve it by isolating the variables and then integrating both sides.

First, separate the variables by multiplying both sides by \(dx\): \[ dy = 3x^2 \, dx \]

Next, integrate both sides of the equation: \[ \int dy = \int 3x^2 \, dx \]

Integrating the left side with respect to \(y\): \[ \int dy = y \]

Integrating the right side with respect to \(x\): \[ \int 3x^2 \, dx = 3 \int x^2 \, dx = 3 \left( \frac{x^{2+1}}{2+1} \right) + C \] \[ = 3 \left( \frac{x^3}{3} \right) + C \] \[ = x^3 + C \]

Combining the results from both sides, we get the general solution: \[ y = x^3 + C \] where \(C\) is the constant of integration.

This is a separable differential equation. We can solve it by isolating the variables and then integrating both sides.

First, separate the variables. Multiply both sides by \(y\) and \(dx\): \[ y \, dy = x \, dx \]

Next, integrate both sides of the equation: \[ \int y \, dy = \int x \, dx \]

Integrating the left side with respect to \(y\): \[ \int y \, dy = \frac{y^2}{2} \]

Integrating the right side with respect to \(x\): \[ \int x \, dx = \frac{x^2}{2} + C \] where \(C\) is the constant of integration.

Now, set the two integrated parts equal to each other: \[ \frac{y^2}{2} = \frac{x^2}{2} + C \]

To simplify the equation, multiply the entire equation by 2: \[ 2 \left( \frac{y^2}{2} \right) = 2 \left( \frac{x^2}{2} + C \right) \] \[ y^2 = x^2 + 2C \]

Since \(2C\) is just another arbitrary constant, we can denote it as \(C_1\): \[ y^2 = x^2 + C_1 \]

Finally, solve for \(y(x)\) by taking the square root of both sides: \[ y(x) = \pm \sqrt{x^2 + C_1} \]

Thus, the general solution is \(y(x) = \pm \sqrt{x^2 + C_1}\).

This is a separable differential equation. We can solve it by isolating the variables and then integrating both sides.

First, separate the variables. To do this, divide both sides by \(y\) and multiply both sides by \(dx\): \[ \frac{1}{y} \, dy = \frac{x}{x^2+1} \, dx \]

Next, integrate both sides of the equation: \[ \int \frac{1}{y} \, dy = \int \frac{x}{x^2+1} \, dx \]

Integrating the Left Side

The integral of \(\frac{1}{y}\) with respect to \(y\) is: \[ \int \frac{1}{y} \, dy = \ln|y| \]

Integrating the Right Side

For the right side, we use a substitution method. Let \(u = x^2+1\). Then, differentiate \(u\) with respect to \(x\): \(du = 2x \, dx\). From this, we can write \(x \, dx = \frac{1}{2} \, du\).

Now substitute these into the integral: \[ \int \frac{x}{x^2+1} \, dx = \int \frac{1}{u} \left( \frac{1}{2} \, du \right) = \frac{1}{2} \int \frac{1}{u} \, du \] \[ = \frac{1}{2} \ln|u| + C \] Substitute back \(u = x^2+1\): \[ = \frac{1}{2} \ln(x^2+1) + C \] Note that we can omit the absolute value for \(x^2+1\) since \(x^2+1\) is always positive.

Combining the Integrals

Now, equate the results from both integrations: \[ \ln|y| = \frac{1}{2} \ln(x^2+1) + C \]

Exponentiate Both Sides

To solve for \(y\), exponentiate both sides with base \(e\): \[ e^{\ln|y|} = e^{\frac{1}{2} \ln(x^2+1) + C} \] \[ |y| = e^{\frac{1}{2} \ln(x^2+1)} \cdot e^C \] Using logarithm properties, \(\frac{1}{2} \ln(x^2+1) = \ln((x^2+1)^{1/2}) = \ln(\sqrt{x^2+1})\): \[ |y| = e^{\ln(\sqrt{x^2+1})} \cdot e^C \] \[ |y| = \sqrt{x^2+1} \cdot e^C \] Let \(C_1 = \pm e^C\). Since \(e^C\) is always positive, \(C_1\) can be any non-zero real number. If we also consider the case where \(y=0\) (which would make \(\ln|y|\) undefined but is a valid solution if \(x=0\)), \(C_1\) can be any real number. \[ y = C_1 \sqrt{x^2+1} \]

Thus, the general solution is \(y = C_1 \sqrt{x^2+1}\).

2. Solution by Integrating Factor Method (Linear First-Order ODEs)

Applicable to all linear first-order differential equations (FODE).

Given the general linear first-order ODE: \[ a_1(x)\frac{dy}{dx} + a_0(x)y = g(x) \]

Step 1: Convert to Standard Form Divide by \(a_1(x)\) (assuming \(a_1(x) \ne 0\)): \[ \frac{dy}{dx} + \frac{a_0(x)}{a_1(x)}y = \frac{g(x)}{a_1(x)} \] This is the standard form: \[ \frac{dy}{dx} + P(x)y = f(x) \] where \(P(x) = \frac{a_0(x)}{a_1(x)}\) and \(f(x) = \frac{g(x)}{a_1(x)}\).

Step 2: Find the Integrating Factor \(\mu(x)\) The integrating factor \(\mu(x)\) is defined as: \[ \mu(x) = e^{\int P(x)\,dx} \] (Note: we typically choose the constant of integration to be zero for simplicity, as any constant factor will cancel out).

Step 3: Multiply by Integrating Factor Multiply both sides of the standard form equation by \(\mu(x)\): \[ \mu(x) \frac{dy}{dx} + \mu(x) P(x)y = \mu(x) f(x) \] The left-hand side is now the derivative of a product: \[ \frac{d}{dx}[\mu(x) y] = \mu(x) f(x) \]

Step 4: Integrate Both Sides Integrate with respect to \(x\): \[ \int \frac{d}{dx}[\mu(x) y]\,dx = \int \mu(x) f(x)\,dx \] \[ \mu(x) y = \int \mu(x) f(x)\,dx + C \]

Step 5: Solve for \(y(x)\) \[ y(x) = \frac{1}{\mu(x)} \left[\int \mu(x) f(x)\,dx + C \right] \]

This is a first-order linear differential equation, which is in the standard form: \[ \frac{dy}{dx} + P(x)y = f(x) \] By comparing our given equation with the standard form, we can identify \(P(x)\) and \(f(x)\): \(P(x) = 1\) \(f(x) = e^x\)

We will solve this using the method of integrating factors.

Step 1: Find the Integrating Factor

The integrating factor, denoted by \(\mu(x)\), is given by the formula: \[ \mu(x) = e^{\int P(x) \, dx} \] Substitute \(P(x) = 1\): \[ \mu(x) = e^{\int 1 \, dx} \] \[ \mu(x) = e^x \]

Step 2: Multiply the Entire Equation by the Integrating Factor

Multiply every term in the original differential equation by the integrating factor \(\mu(x) = e^x\): \[ e^x \frac{dy}{dx} + e^x y = e^x \cdot e^x \] \[ e^x \frac{dy}{dx} + e^x y = e^{2x} \] The left-hand side of this equation is now the derivative of the product of \(y\) and the integrating factor, i.e., \(\frac{d}{dx}(\mu(x)y)\): \[ \frac{d}{dx}(e^x y) = e^{2x} \]

Step 3: Integrate Both Sides

Now, integrate both sides with respect to \(x\): \[ \int \frac{d}{dx}(e^x y) \, dx = \int e^{2x} \, dx \] Integrating the left side simply yields \(e^x y\): \[ e^x y = \int e^{2x} \, dx \] For the right side, we integrate \(e^{2x}\). This requires a simple substitution (e.g., \(u=2x\), \(du=2dx\)): \[ \int e^{2x} \, dx = \frac{1}{2} e^{2x} + C \] So, we have: \[ e^x y = \frac{1}{2} e^{2x} + C \]

Step 4: Solve for \(y\)

Finally, divide both sides by \(e^x\) to isolate \(y\): \[ y = \frac{1}{e^x} \left( \frac{1}{2} e^{2x} + C \right) \] \[ y = \frac{1}{2} \frac{e^{2x}}{e^x} + \frac{C}{e^x} \] \[ y = \frac{1}{2} e^{2x-x} + C e^{-x} \] \[ y = \frac{1}{2} e^x + C e^{-x} \]

Thus, the general solution to the differential equation is \(y = \frac{1}{2} e^x + C e^{-x}\).

This is a first-order linear differential equation, which is in the standard form: \[ \frac{dy}{dx} + P(x)y = f(x) \] By comparing our given equation with the standard form, we can identify \(P(x)\) and \(f(x)\): \(P(x) = -\frac{2}{x}\) \(f(x) = x^2\)

We will solve this using the method of integrating factors.

Step 1: Find the Integrating Factor

The integrating factor, denoted by \(\mu(x)\), is given by the formula: \[ \mu(x) = e^{\int P(x) \, dx} \] Substitute \(P(x) = -\frac{2}{x}\): \[ \mu(x) = e^{\int -\frac{2}{x} \, dx} \] \[ \mu(x) = e^{-2 \int \frac{1}{x} \, dx} \] \[ \mu(x) = e^{-2 \ln|x|} \] Since \(x > 0\), we can remove the absolute value: \[ \mu(x) = e^{-2 \ln x} \] Using logarithm properties, \(a \ln b = \ln(b^a)\): \[ \mu(x) = e^{\ln(x^{-2})} \] \[ \mu(x) = x^{-2} \]

Step 2: Multiply the Entire Equation by the Integrating Factor

Multiply every term in the original differential equation by the integrating factor \(\mu(x) = x^{-2}\): \[ x^{-2} \left( \frac{dy}{dx} - \frac{2}{x} y \right) = x^{-2} \cdot x^2 \] \[ x^{-2} \frac{dy}{dx} - 2x^{-3} y = x^0 \] \[ x^{-2} \frac{dy}{dx} - 2x^{-3} y = 1 \] The left-hand side of this equation is now the derivative of the product of \(y\) and the integrating factor, i.e., \(\frac{d}{dx}(\mu(x)y)\): \[ \frac{d}{dx}(x^{-2} y) = 1 \]

Step 3: Integrate Both Sides

Now, integrate both sides with respect to \(x\): \[ \int \frac{d}{dx}(x^{-2} y) \, dx = \int 1 \, dx \] Integrating the left side simply yields \(x^{-2} y\): \[ x^{-2} y = \int 1 \, dx \] Integrating the right side: \[ \int 1 \, dx = x + C \] So, we have: \[ x^{-2} y = x + C \]

Step 4: Solve for \(y\)

Finally, multiply both sides by \(x^2\) (which is \(1/x^{-2}\)) to isolate \(y\): \[ y = x^2 (x + C) \] Distribute \(x^2\): \[ y = x^3 + Cx^2 \]

Thus, the general solution to the differential equation is \(y = x^3 + Cx^2\).

This is a first-order linear differential equation, which is in the standard form: \[ \frac{dy}{dx} + P(x)y = f(x) \] By comparing our given equation with the standard form, we can identify \(P(x)\) and \(f(x)\): \(P(x) = \tan(x)\) \(f(x) = \sec(x)\)

We will solve this using the method of integrating factors.

Step 1: Find the Integrating Factor

The integrating factor, denoted by \(\mu(x)\), is given by the formula: \[ \mu(x) = e^{\int P(x) \, dx} \] Substitute \(P(x) = \tan(x)\): \[ \mu(x) = e^{\int \tan(x) \, dx} \] The integral of \(\tan(x)\) is \(\ln|\sec(x)|\) or \(-\ln|\cos(x)|\). Using \(-\ln|\cos(x)|\): \[ \mu(x) = e^{-\ln|\cos(x)|} \] Using logarithm properties, \(a \ln b = \ln(b^a)\): \[ \mu(x) = e^{\ln(|\cos(x)|^{-1})} \] \[ \mu(x) = |\cos(x)|^{-1} = \frac{1}{|\cos(x)|} = |\sec(x)| \] For simplicity and assuming a domain where \(\sec(x)\) maintains a consistent sign, we typically use \(\mu(x) = \sec(x)\) (or \(\frac{1}{\cos(x)}\)).

Step 2: Multiply the Entire Equation by the Integrating Factor

Multiply every term in the original differential equation by the integrating factor \(\mu(x) = \sec(x)\): \[ \sec(x) \frac{dy}{dx} + \sec(x) \tan(x) y = \sec(x) \cdot \sec(x) \] \[ \sec(x) \frac{dy}{dx} + \sec(x) \tan(x) y = \sec^2(x) \] The left-hand side of this equation is now the derivative of the product of \(y\) and the integrating factor, i.e., \(\frac{d}{dx}(\mu(x)y)\): \[ \frac{d}{dx}[\sec(x)y] = \sec^2(x) \]

Step 3: Integrate Both Sides

Now, integrate both sides with respect to \(x\): \[ \int \frac{d}{dx}[\sec(x)y] \, dx = \int \sec^2(x) \, dx \] Integrating the left side simply yields \(\sec(x)y\): \[ \sec(x)y = \int \sec^2(x) \, dx \] The integral of \(\sec^2(x)\) is \(\tan(x)\): \[ \int \sec^2(x) \, dx = \tan(x) + C \] So, we have: \[ \sec(x)y = \tan(x) + C \]

Step 4: Solve for \(y\)

Finally, divide both sides by \(\sec(x)\) (or multiply by \(\cos(x)\)) to isolate \(y\): \[ y = \frac{\tan(x) + C}{\sec(x)} \] We can simplify this expression using trigonometric identities (\(\tan(x) = \frac{\sin(x)}{\cos(x)}\) and \(\sec(x) = \frac{1}{\cos(x)}\)): \[ y = \cos(x) (\tan(x) + C) \] Distributing \(\cos(x)\): \[ y = \cos(x) \tan(x) + C \cos(x) \] \[ y = \cos(x) \frac{\sin(x)}{\cos(x)} + C \cos(x) \] \[ y = \sin(x) + C \cos(x) \]

Thus, the general solution to the differential equation is \(y = \sin(x) + C \cos(x)\).

Note: While \(\mu(x) = \sec(x)\) is commonly used for simplicity, strictly speaking, the absolute value in the integral of \(\tan(x)\) means \(\mu(x)\) could be \(|\sec(x)|\). However, for linear differential equations, using a positive integrating factor is sufficient, as the constant of integration \(C\) accounts for all possible solutions.

3. Exact Differential Equations

General Form: \[ M(x, y)\,dx + N(x, y)\,dy = 0 \]

A differential equation of this form is exact if there exists a function \(F(x, y)\) such that its total differential \(dF\) is equal to \(M(x, y)\,dx + N(x, y)\,dy\). This means: \[ dF = \frac{\partial F}{\partial x}dx + \frac{\partial F}{\partial y}dy \] So, \(M(x, y) = \frac{\partial F}{\partial x}\) and \(N(x, y) = \frac{\partial F}{\partial y}\).

Test for exactness: For an equation to be exact, the mixed partial derivatives must be equal: \[ \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} \]

Steps to Solve an Exact Equation: 1. Verify exactness using the test condition. 2. Integrate \(M(x, y)\) with respect to \(x\) (treating \(y\) as a constant) to find \(F(x, y)\): \(F(x, y) = \int M(x, y)\,dx + h(y)\) (where \(h(y)\) is an arbitrary function of \(y\)) 3. Alternatively, integrate \(N(x, y)\) with respect to \(y\) (treating \(x\) as a constant) to find \(F(x, y)\): \(F(x, y) = \int N(x, y)\,dy + k(x)\) (where \(k(x)\) is an arbitrary function of \(x\)) 4. Differentiate the obtained \(F(x, y)\) (from step 2) with respect to \(y\) and set it equal to \(N(x, y)\) to find \(h'(y)\). Integrate \(h'(y)\) to find \(h(y)\). (If using step 3, differentiate with respect to \(x\) and set equal to \(M(x,y)\) to find \(k'(x)\), then integrate for \(k(x)\).) 5. Substitute the found \(h(y)\) (or \(k(x)\)) back into \(F(x, y)\). 6. The general solution is implicitly given by \(F(x, y) = C\), where \(C\) is an arbitrary constant.

This differential equation is in the form \(M(x,y) \, dx + N(x,y) \, dy = 0\). Let’s identify \(M(x,y)\) and \(N(x,y)\): \(M(x,y) = 2xy + y^2\) \(N(x,y) = x^2 + 2xy\)

Step 1: Check for Exactness

A differential equation is exact if \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\).

First, find the partial derivative of \(M\) with respect to \(y\): \[ \frac{\partial M}{\partial y} = \frac{\partial}{\partial y}(2xy + y^2) = 2x + 2y \]

Next, find the partial derivative of \(N\) with respect to \(x\): \[ \frac{\partial N}{\partial x} = \frac{\partial}{\partial x}(x^2 + 2xy) = 2x + 2y \]

Since \(\frac{\partial M}{\partial y} = 2x + 2y\) and \(\frac{\partial N}{\partial x} = 2x + 2y\), we have \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\). Therefore, the differential equation is exact.

Step 2: Find the Potential Function \(F(x,y)\)

Since the equation is exact, there exists a potential function \(F(x,y)\) such that \(\frac{\partial F}{\partial x} = M\) and \(\frac{\partial F}{\partial y} = N\).

Integrate \(M(x,y)\) with respect to \(x\), treating \(y\) as a constant. This integral will include an arbitrary function of \(y\), denoted as \(h(y)\): \[ F(x,y) = \int M(x,y) \, dx = \int (2xy + y^2) \, dx \] \[ F(x,y) = 2y \int x \, dx + y^2 \int 1 \, dx \] \[ F(x,y) = 2y \left( \frac{x^2}{2} \right) + y^2 (x) + h(y) \] \[ F(x,y) = x^2y + xy^2 + h(y) \]

Step 3: Differentiate \(F(x,y)\) with respect to \(y\) and Compare with \(N(x,y)\)

Now, differentiate the expression for \(F(x,y)\) with respect to \(y\), treating \(x\) as a constant: \[ \frac{\partial F}{\partial y} = \frac{\partial}{\partial y}(x^2y + xy^2 + h(y)) \] \[ \frac{\partial F}{\partial y} = x^2 + 2xy + h'(y) \] We know that \(\frac{\partial F}{\partial y}\) must be equal to \(N(x,y)\). So, set them equal: \[ x^2 + 2xy + h'(y) = N(x,y) \] \[ x^2 + 2xy + h'(y) = x^2 + 2xy \] From this comparison, we can see that: \[ h'(y) = 0 \]

Step 4: Integrate \(h'(y)\) to Find \(h(y)\)

Integrate \(h'(y)\) with respect to \(y\) to find \(h(y)\): \[ \int h'(y) \, dy = \int 0 \, dy \] \[ h(y) = C_0 \] where \(C_0\) is an arbitrary constant.

Step 5: Write the General Solution

Substitute \(h(y) = C_0\) back into the expression for \(F(x,y)\): \[ F(x,y) = x^2y + xy^2 + C_0 \] The general solution to an exact differential equation is given by \(F(x,y) = C\), where \(C\) is a constant. We can absorb \(C_0\) into this general constant. \[ x^2y + xy^2 = C \]

Thus, the general solution to the differential equation is \(x^2y + xy^2 = C\).

This differential equation is in the form \(M(x,y) \, dx + N(x,y) \, dy = 0\). Let’s identify \(M(x,y)\) and \(N(x,y)\): \(M(x,y) = y \cos(xy) + 1\) \(N(x,y) = x \cos(xy)\)

Step 1: Check for Exactness

A differential equation is exact if \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\).

First, find the partial derivative of \(M\) with respect to \(y\). We’ll need the product rule for \(y \cos(xy)\): \[ \frac{\partial M}{\partial y} = \frac{\partial}{\partial y}(y \cos(xy) + 1) \] Using the product rule \((uv)' = u'v + uv'\) where \(u=y\), \(v=\cos(xy)\): \(\frac{\partial u}{\partial y} = 1\) \(\frac{\partial v}{\partial y} = -\sin(xy) \cdot x = -x \sin(xy)\) So, \(\frac{\partial}{\partial y}(y \cos(xy)) = (1)\cos(xy) + y(-x \sin(xy)) = \cos(xy) - xy \sin(xy)\). Therefore: \[ \frac{\partial M}{\partial y} = \cos(xy) - xy \sin(xy) \]

Next, find the partial derivative of \(N\) with respect to \(x\). We’ll also need the product rule for \(x \cos(xy)\): \[ \frac{\partial N}{\partial x} = \frac{\partial}{\partial x}(x \cos(xy)) \] Using the product rule \((uv)' = u'v + uv'\) where \(u=x\), \(v=\cos(xy)\): \(\frac{\partial u}{\partial x} = 1\) \(\frac{\partial v}{\partial x} = -\sin(xy) \cdot y = -y \sin(xy)\) So, \(\frac{\partial}{\partial x}(x \cos(xy)) = (1)\cos(xy) + x(-y \sin(xy)) = \cos(xy) - xy \sin(xy)\). Therefore: \[ \frac{\partial N}{\partial x} = \cos(xy) - xy \sin(xy) \]

Since \(\frac{\partial M}{\partial y} = \cos(xy) - xy \sin(xy)\) and \(\frac{\partial N}{\partial x} = \cos(xy) - xy \sin(xy)\), we have \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\). Therefore, the differential equation is exact.

Step 2: Find the Potential Function \(F(x,y)\)

Since the equation is exact, there exists a potential function \(F(x,y)\) such that \(\frac{\partial F}{\partial x} = M\) and \(\frac{\partial F}{\partial y} = N\).

Integrate \(M(x,y)\) with respect to \(x\), treating \(y\) as a constant. This integral will include an arbitrary function of \(y\), denoted as \(h(y)\): \[ F(x,y) = \int M(x,y) \, dx = \int (y \cos(xy) + 1) \, dx \] To integrate \(y \cos(xy)\) with respect to \(x\), let \(u = xy\). Then \(du = y \, dx\) (since \(y\) is constant for this integration). \[ \int y \cos(xy) \, dx = \int \cos(u) \, du = \sin(u) = \sin(xy) \] So, integrating \(M(x,y)\): \[ F(x,y) = \sin(xy) + x + h(y) \]

Step 3: Differentiate \(F(x,y)\) with respect to \(y\) and Compare with \(N(x,y)\)

Now, differentiate the expression for \(F(x,y)\) with respect to \(y\), treating \(x\) as a constant: \[ \frac{\partial F}{\partial y} = \frac{\partial}{\partial y}(\sin(xy) + x + h(y)) \] For \(\sin(xy)\), using the chain rule, \(\frac{\partial}{\partial y}(\sin(xy)) = \cos(xy) \cdot x = x \cos(xy)\). Therefore: \[ \frac{\partial F}{\partial y} = x \cos(xy) + 0 + h'(y) \] \[ \frac{\partial F}{\partial y} = x \cos(xy) + h'(y) \] We know that \(\frac{\partial F}{\partial y}\) must be equal to \(N(x,y)\). So, set them equal: \[ x \cos(xy) + h'(y) = N(x,y) \] \[ x \cos(xy) + h'(y) = x \cos(xy) \] From this comparison, we can see that: \[ h'(y) = 0 \]

Step 4: Integrate \(h'(y)\) to Find \(h(y)\)

Integrate \(h'(y)\) with respect to \(y\) to find \(h(y)\): \[ \int h'(y) \, dy = \int 0 \, dy \] \[ h(y) = C_0 \] where \(C_0\) is an arbitrary constant.

Step 5: Write the General Solution

Substitute \(h(y) = C_0\) back into the expression for \(F(x,y)\): \[ F(x,y) = \sin(xy) + x + C_0 \] The general solution to an exact differential equation is given by \(F(x,y) = C\), where \(C\) is a constant. We can absorb \(C_0\) into this general constant. \[ \sin(xy) + x = C \]

Thus, the general solution to the differential equation is \(\sin(xy) + x = C\).

4. Integrating Factor for Non-Exact Equations (Special Cases)

If \(M(x, y)\,dx + N(x, y)\,dy = 0\) is not exact, we might be able to find an integrating factor \(\mu(x, y)\) such that \(\mu M\,dx + \mu N\,dy = 0\) is exact.

  • If \(\mu\) depends only on \(x\): This is possible if \(\frac{\frac{\partial M}{\partial y} - \frac{\partial N}{\partial x}}{N}\) is a function of \(x\) only. Then the integrating factor is: \[ \mu(x) = \exp\left(\int \frac{\frac{\partial M}{\partial y} - \frac{\partial N}{\partial x}}{N} \; dx\right) \]

  • If \(\mu\) depends only on \(y\): This is possible if \(\frac{\frac{\partial N}{\partial x} - \frac{\partial M}{\partial y}}{M}\) is a function of \(y\) only. Then the integrating factor is: \[ \mu(y) = \exp\left(\int \frac{\frac{\partial N}{\partial x} - \frac{\partial M}{\partial y}}{M} \; dy\right) \]

  • Other cases for finding \(\mu\) (More advanced/specific): Sometimes an integrating factor can be found in forms like \(\mu(x+y)\), \(\mu(xy)\), or by inspection, but the formulas above are the most common general approaches for non-exact equations. The expressions \(\frac{1}{M_x + N_y}\) or \(\frac{1}{M_y - N_x}\) are not general integrating factors; they might appear in specific contexts or derivations for certain types of non-exact equations, but they are not universal formulas for \(\mu\).

This differential equation is in the form \(M(x,y) \, dx + N(x,y) \, dy = 0\). Let’s identify \(M(x,y)\) and \(N(x,y)\): \(M(x,y) = xy\) \(N(x,y) = 2x^2 + 3y^2 - 20\)

Step 1: Check for Exactness

First, find the partial derivative of \(M\) with respect to \(y\): \[ \frac{\partial M}{\partial y} = \frac{\partial}{\partial y}(xy) = x \]

Next, find the partial derivative of \(N\) with respect to \(x\): \[ \frac{\partial N}{\partial x} = \frac{\partial}{\partial x}(2x^2 + 3y^2 - 20) = 4x \]

Since \(\frac{\partial M}{\partial y} = x\) and \(\frac{\partial N}{\partial x} = 4x\), we have \(\frac{\partial M}{\partial y} \neq \frac{\partial N}{\partial x}\). Therefore, the differential equation is not exact.

Step 2: Find an Integrating Factor

Since the equation is not exact, we look for an integrating factor \(\mu(x)\) or \(\mu(y)\).

Let’s check the two common forms: Case 1: Integrating factor depends only on \(x\). Calculate \(\frac{1}{N} \left( \frac{\partial M}{\partial y} - \frac{\partial N}{\partial x} \right)\): \[ \frac{1}{N} \left( \frac{\partial M}{\partial y} - \frac{\partial N}{\partial x} \right) = \frac{x - 4x}{2x^2 + 3y^2 - 20} = \frac{-3x}{2x^2 + 3y^2 - 20} \] This expression is not a function of \(x\) alone (it depends on \(y\)). So, there is no integrating factor that is solely a function of \(x\).

Case 2: Integrating factor depends only on \(y\). Calculate \(\frac{1}{M} \left( \frac{\partial N}{\partial x} - \frac{\partial M}{\partial y} \right)\): \[ \frac{1}{M} \left( \frac{\partial N}{\partial x} - \frac{\partial M}{\partial y} \right) = \frac{4x - x}{xy} = \frac{3x}{xy} = \frac{3}{y} \] This expression is a function of \(y\) alone. Therefore, we can find an integrating factor \(\mu(y)\).

The integrating factor \(\mu(y)\) is given by: \[ \mu(y) = e^{\int \frac{1}{M} \left( \frac{\partial N}{\partial x} - \frac{\partial M}{\partial y} \right) \, dy} \] \[ \mu(y) = e^{\int \frac{3}{y} \, dy} \] \[ \mu(y) = e^{3 \ln|y|} \] Assuming \(y > 0\) for simplicity, or taking the general case where \(y^3\) encompasses the sign: \[ \mu(y) = e^{\ln(y^3)} \] \[ \mu(y) = y^3 \]

Step 3: Multiply the Original Equation by the Integrating Factor

Multiply every term in the original differential equation by \(\mu(y) = y^3\): \[ y^3 (xy) \, dx + y^3 (2x^2 + 3y^2 - 20) \, dy = 0 \] \[ (xy^4) \, dx + (2x^2y^3 + 3y^5 - 20y^3) \, dy = 0 \] Now, let’s redefine our \(M_{new}\) and \(N_{new}\): \(M_{new}(x,y) = xy^4\) \(N_{new}(x,y) = 2x^2y^3 + 3y^5 - 20y^3\)

Step 4: Verify the New Equation is Exact

Check for exactness for the new equation: \[ \frac{\partial M_{new}}{\partial y} = \frac{\partial}{\partial y}(xy^4) = 4xy^3 \] \[ \frac{\partial N_{new}}{\partial x} = \frac{\partial}{\partial x}(2x^2y^3 + 3y^5 - 20y^3) = 4xy^3 + 0 - 0 = 4xy^3 \] Since \(\frac{\partial M_{new}}{\partial y} = \frac{\partial N_{new}}{\partial x}\), the new differential equation is indeed exact.

Step 5: Find the Potential Function \(F(x,y)\)

Integrate \(M_{new}(x,y)\) with respect to \(x\), treating \(y\) as a constant: \[ F(x,y) = \int M_{new}(x,y) \, dx = \int (xy^4) \, dx \] \[ F(x,y) = y^4 \int x \, dx \] \[ F(x,y) = y^4 \left( \frac{x^2}{2} \right) + h(y) \] \[ F(x,y) = \frac{1}{2}x^2y^4 + h(y) \]

Step 6: Differentiate \(F(x,y)\) with respect to \(y\) and Compare with \(N_{new}(x,y)\)

Now, differentiate \(F(x,y)\) with respect to \(y\), treating \(x\) as a constant: \[ \frac{\partial F}{\partial y} = \frac{\partial}{\partial y}\left(\frac{1}{2}x^2y^4 + h(y)\right) \] \[ \frac{\partial F}{\partial y} = \frac{1}{2}x^2 (4y^3) + h'(y) \] \[ \frac{\partial F}{\partial y} = 2x^2y^3 + h'(y) \] Set this equal to \(N_{new}(x,y)\): \[ 2x^2y^3 + h'(y) = 2x^2y^3 + 3y^5 - 20y^3 \] From this comparison: \[ h'(y) = 3y^5 - 20y^3 \]

Step 7: Integrate \(h'(y)\) to Find \(h(y)\)

Integrate \(h'(y)\) with respect to \(y\): \[ h(y) = \int (3y^5 - 20y^3) \, dy \] \[ h(y) = 3 \left( \frac{y^6}{6} \right) - 20 \left( \frac{y^4}{4} \right) + C_0 \] \[ h(y) = \frac{1}{2}y^6 - 5y^4 + C_0 \]

Step 8: Write the General Solution

Substitute \(h(y)\) back into the expression for \(F(x,y)\): \[ F(x,y) = \frac{1}{2}x^2y^4 + \frac{1}{2}y^6 - 5y^4 + C_0 \] The general solution is \(F(x,y) = C\), where \(C\) is an arbitrary constant (absorbing \(C_0\)). \[ \frac{1}{2}x^2y^4 + \frac{1}{2}y^6 - 5y^4 = C \] We can also multiply by 2 to clear the fractions: \[ x^2y^4 + y^6 - 10y^4 = C' \] where \(C' = 2C\).

Thus, the general solution to the differential equation is \(x^2y^4 + y^6 - 10y^4 = C\).

5. Solution by Substitution

a. Homogeneous Equations

A first-order differential equation \(M(x, y) dx + N(x, y) dy = 0\) (or \(dy/dx = f(x,y)\)) is homogeneous if \(M(x,y)\) and \(N(x,y)\) are homogeneous functions of the same degree. A function \(F(x,y)\) is homogeneous of degree \(k\) if \(F(tx, ty) = t^k F(x, y)\) for some constant \(k\).

Substitutions for Homogeneous Equations: - If \(N(x,y)\) is simpler or \(dy/dx = f(x,y)\) is easier to express as \(f(y/x)\): Let \(y = ux \Rightarrow dy = u\,dx + x\,du\). - If \(M(x,y)\) is simpler or \(dx/dy = g(x,y)\) is easier to express as \(g(x/y)\): Let \(x = vy \Rightarrow dx = v\,dy + y\,dv\).

These substitutions transform the homogeneous equation into a separable equation in terms of \(u\) (or \(v\)) and \(x\) (or \(y\)).

b. Bernoulli’s Equation

General form: \[ \frac{dy}{dx} + P(x)y = F(x)y^n \] This is a non-linear first-order ODE.

  • If \(n=0\): The equation becomes \(\frac{dy}{dx} + P(x)y = F(x)\), which is a linear first-order ODE solvable by the integrating factor method.
  • If \(n=1\): The equation becomes \(\frac{dy}{dx} + P(x)y = F(x)y \Rightarrow \frac{dy}{dx} = (F(x)-P(x))y\), which is a separable equation.
  • If \(n \neq 0\) and \(n \neq 1\): Substitution: Let \(u = y^{1-n}\). Then \(\frac{du}{dx} = (1-n)y^{-n}\frac{dy}{dx}\). From the original equation, \(\frac{dy}{dx} = F(x)y^n - P(x)y\). Substitute \(\frac{dy}{dx}\) and \(y = u^{1/(1-n)}\) into the expression for \(\frac{du}{dx}\). This substitution transforms Bernoulli’s equation into a linear first-order ODE in terms of \(u\), which can then be solved using the integrating factor method.
c. Reduction to Separation of Variables (for \(dy/dx = F(Ax + By + C)\))

Given an equation of the form: \[ \frac{dy}{dx} = F(Ax + By + C) \]

  • If \(B \neq 0\): Substitution: Let \(u = Ax + By + C\). Then \(\frac{du}{dx} = A + B\frac{dy}{dx}\). So, \(\frac{dy}{dx} = \frac{1}{B}\left(\frac{du}{dx} - A\right)\). Substitute these into the original equation: \(\frac{1}{B}\left(\frac{du}{dx} - A\right) = F(u)\) \(\frac{du}{dx} = B F(u) + A\) This is a separable equation in terms of \(u\) and \(x\).

This is a homogeneous differential equation because all terms in the numerator and denominator have the same degree (degree 1). We can rewrite the equation as: \[ \frac{dy}{dx} = 1 + \frac{y}{x} \]

Step 1: Apply the Homogeneous Substitution

For homogeneous equations, we use the substitution \(y = vx\), where \(v\) is a function of \(x\). From \(y = vx\), we can find \(\frac{dy}{dx}\) using the product rule: \[ \frac{dy}{dx} = v \cdot \frac{d}{dx}(x) + x \cdot \frac{dv}{dx} \] \[ \frac{dy}{dx} = v + x \frac{dv}{dx} \]

Step 2: Substitute into the Original Equation

Substitute \(y = vx\) and \(\frac{dy}{dx} = v + x \frac{dv}{dx}\) into the rewritten differential equation \(\frac{dy}{dx} = 1 + \frac{y}{x}\): \[ v + x \frac{dv}{dx} = 1 + \frac{vx}{x} \] \[ v + x \frac{dv}{dx} = 1 + v \] Subtract \(v\) from both sides: \[ x \frac{dv}{dx} = 1 \]

Step 3: Separate Variables

Now, the equation is separable. Separate the variables \(v\) and \(x\): \[ dv = \frac{1}{x} \, dx \]

Step 4: Integrate Both Sides

Integrate both sides of the separated equation: \[ \int dv = \int \frac{1}{x} \, dx \] Integrating the left side: \[ \int dv = v \] Integrating the right side: \[ \int \frac{1}{x} \, dx = \ln|x| + C \] So, we have: \[ v = \ln|x| + C \]

Step 5: Back-Substitute to Express Solution in Terms of \(y\) and \(x\)

Recall our substitution \(y = vx\), which means \(v = \frac{y}{x}\). Substitute this back into the solution for \(v\): \[ \frac{y}{x} = \ln|x| + C \] Finally, solve for \(y\): \[ y = x(\ln|x| + C) \] \[ y = x \ln|x| + Cx \]

Thus, the general solution to the differential equation is \(y = x \ln|x| + Cx\).

This is a Bernoulli differential equation, which has the general form: \[ \frac{dy}{dx} + P(x)y = Q(x)y^n \] By comparing our given equation with the standard form: \(P(x) = 1\) \(Q(x) = \sin x\) \(n = 2\)

Since \(n=2\) (and \(n \neq 0, 1\)), we use a substitution to transform it into a linear first-order differential equation.

Step 1: Divide by \(y^n\)

Divide the entire equation by \(y^2\): \[ \frac{1}{y^2} \frac{dy}{dx} + \frac{y}{y^2} = \sin x \] \[ y^{-2} \frac{dy}{dx} + y^{-1} = \sin x \]

Step 2: Apply the Bernoulli Substitution

Let \(u = y^{1-n}\). In this case, \(n=2\), so: \[ u = y^{1-2} = y^{-1} \] Now, find \(\frac{du}{dx}\) by differentiating \(u = y^{-1}\) with respect to \(x\) using the chain rule: \[ \frac{du}{dx} = -1 \cdot y^{-2} \frac{dy}{dx} = -y^{-2} \frac{dy}{dx} \] From this, we can see that \(y^{-2} \frac{dy}{dx} = -\frac{du}{dx}\).

Substitute \(u\) and \(\frac{du}{dx}\) into the transformed equation (\(y^{-2} \frac{dy}{dx} + y^{-1} = \sin x\)): \[ -\frac{du}{dx} + u = \sin x \] To get it into standard linear form (\(\frac{du}{dx} + P(x)u = Q(x)\)), multiply by \(-1\): \[ \frac{du}{dx} - u = -\sin x \] This is now a linear first-order differential equation in terms of \(u\). Here, \(P(x) = -1\) and \(Q(x) = -\sin x\).

Step 3: Solve the Linear ODE using an Integrating Factor

Find the integrating factor \(\mu(x)\): \[ \mu(x) = e^{\int P(x) \, dx} = e^{\int -1 \, dx} = e^{-x} \]

Multiply the linear ODE (\(\frac{du}{dx} - u = -\sin x\)) by the integrating factor \(e^{-x}\): \[ e^{-x} \frac{du}{dx} - e^{-x} u = -e^{-x} \sin x \] The left-hand side is the derivative of the product \((u \cdot e^{-x})\): \[ \frac{d}{dx}(u e^{-x}) = -e^{-x} \sin x \]

Integrate both sides with respect to \(x\): \[ \int \frac{d}{dx}(u e^{-x}) \, dx = \int -e^{-x} \sin x \, dx \] \[ u e^{-x} = -\int e^{-x} \sin x \, dx \] The integral \(\int e^{ax} \sin(bx) \, dx = \frac{e^{ax}}{a^2+b^2}(a \sin(bx) - b \cos(bx))\). Here, \(a=-1\) and \(b=1\): \[ \int e^{-x} \sin x \, dx = \frac{e^{-x}}{(-1)^2+1^2}((-1) \sin x - (1) \cos x) \] \[ = \frac{e^{-x}}{2}(-\sin x - \cos x) = -\frac{1}{2}e^{-x}(\sin x + \cos x) \] So, for \(-\int e^{-x} \sin x \, dx\): \[ -\left( -\frac{1}{2}e^{-x}(\sin x + \cos x) \right) + C = \frac{1}{2}e^{-x}(\sin x + \cos x) + C \] Therefore: \[ u e^{-x} = \frac{1}{2}e^{-x}(\sin x + \cos x) + C \]

Step 4: Solve for \(u\)

Divide both sides by \(e^{-x}\): \[ u = \frac{1}{2}(\sin x + \cos x) + C e^{x} \]

Step 5: Back-Substitute to Express Solution in Terms of \(y\) and \(x\)

Recall our substitution \(u = y^{-1} = \frac{1}{y}\). Substitute this back into the solution for \(u\): \[ \frac{1}{y} = \frac{1}{2}(\sin x + \cos x) + C e^{x} \] To solve for \(y\), take the reciprocal of both sides: \[ y = \frac{1}{\frac{1}{2}(\sin x + \cos x) + C e^{x}} \]

Thus, the general solution to the differential equation is \(y = \frac{1}{\frac{1}{2}(\sin x + \cos x) + C e^{x}}\).

This differential equation is not immediately separable, linear, exact, or homogeneous. However, it has the form \(f(ax+by+c)\), which suggests a substitution.

Step 1: Apply the Substitution

Let \(u = x+y\). Now, differentiate \(u\) with respect to \(x\): \[ \frac{du}{dx} = \frac{d}{dx}(x+y) \] \[ \frac{du}{dx} = 1 + \frac{dy}{dx} \] From this, we can express \(\frac{dy}{dx}\) in terms of \(u\) and \(x\): \[ \frac{dy}{dx} = \frac{du}{dx} - 1 \]

Step 2: Substitute into the Original Equation

Substitute \(u = x+y\) and \(\frac{dy}{dx} = \frac{du}{dx} - 1\) into the original differential equation \(\frac{dy}{dx} = (x+y)^2\): \[ \frac{du}{dx} - 1 = u^2 \] Now, rearrange this to make it a separable equation: \[ \frac{du}{dx} = 1 + u^2 \]

Step 3: Separate Variables

Separate the variables \(u\) and \(x\): \[ \frac{du}{1+u^2} = dx \]

Step 4: Integrate Both Sides

Integrate both sides of the separated equation: \[ \int \frac{1}{1+u^2} \, du = \int 1 \, dx \] The integral of \(\frac{1}{1+u^2}\) is \(\arctan(u)\) (or \(\tan^{-1}(u)\)): \[ \arctan(u) = x + C \] where \(C\) is the constant of integration.

Step 5: Back-Substitute to Express Solution in Terms of \(y\) and \(x\)

Recall our substitution \(u = x+y\). Substitute this back into the solution: \[ \arctan(x+y) = x + C \]

This is the implicit general solution to the differential equation.

If an explicit solution for \(y\) is desired, we can take the tangent of both sides: \[ x+y = \tan(x+C) \] \[ y = \tan(x+C) - x \]

Thus, the general solution is \(\arctan(x+y) = x + C\) (implicit form) or \(y = \tan(x+C) - x\) (explicit form).

General Strategy for First-Order ODEs:

  • When given \(M(x,y) dx + N(x,y) dy = 0\):
    1. Check for Exactness: Is \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\)?
      • If Yes: Solve as an exact equation.
      • If No: Proceed.
    2. Check for Homogeneity: Are \(M(x,y)\) and \(N(x,y)\) homogeneous functions of the same degree?
      • If Yes: Use substitution (\(y=ux\) or \(x=vy\)) to convert to a separable equation.
      • If No: Proceed.
    3. Check if Linear: Can it be written as \(\frac{dy}{dx} + P(x)y = f(x)\)?
      • If Yes: Use the integrating factor method.
      • If No: Proceed.
    4. Check if Bernoulli: Can it be written as \(\frac{dy}{dx} + P(x)y = F(x)y^n\)?
      • If Yes: Use the substitution \(u = y^{1-n}\) to convert to a linear equation.
      • If No: Proceed.
    5. Check for \(F(Ax+By+C)\) form: Can it be written as \(\frac{dy}{dx} = F(Ax+By+C)\)?
      • If Yes: Use the substitution \(u = Ax+By+C\) to convert to a separable equation.
      • If No: Look for an appropriate integrating factor to make it exact (special cases) or it might be a more advanced type of equation.

Error Function

The error function is a special function often encountered in solutions of differential equations related to diffusion or probability. It is defined as: \[ \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt \] Its complementary form is: \[ \text{erfc}(x) = 1 - \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2} dt \] - The denominator usually includes \(\sqrt{\pi}\).


Flowcharts for Solution Strategies

Flowchart 1: Solving Bernoulli’s Equation

flowchart TD
    A["dy/dx + P(x)y = F(x)yⁿ"] --> B["If n ≥ 2"]
    A --> C["If n = 0 or 1"]
    
    B --> D["Substitute u = y¹⁻ⁿ"]
    D --> E["Then use integrating factor method"]
    
    C --> F["Integrating factor method"]
Figure 1: How Quarto orchestrates rendering of documents: start with a qmd file, use the Knitr or Jupyter engine to perform the computations and convert it to an md file, then use Pandoc to convert to various file formats including HTML, PDF, and Word.

flowchart TD
    A["M(x,y)dx + N(x,y)dy"] --> B["If it is not Homogeneous"]
    A --> C["Check if it is Homogeneous"]
    
    B --> D["Then it must be exact"]
    D --> E["Otherwise make exact"]
    
    C --> F["If so substitute y=vx then solve as seperable equations"]