Answer:
To solve the first-order linear differential equation \((x-1)y' = y - 2\) with the initial condition \(y(0) = 0\), you can use an integrating factor. The integrating factor for this equation is \(e^{\int (x-1)dx}\). Let's compute this:
\[
\int (x-1)dx = \frac{1}{2}x^2 - x + C
\]
Now, the integrating factor is \(e^{\frac{1}{2}x^2 - x + C}\). We can write this as:
\[
e^{\frac{1}{2}x^2 - x}e^C = e^{\frac{1}{2}x^2 - x}K
\]
Where \(K = e^C\) is just a constant.
Now, multiply both sides of the differential equation by this integrating factor:
\[
e^{\frac{1}{2}x^2 - x}K(x - 1)y' = e^{\frac{1}{2}x^2 - x}K(y - 2)
\]
Notice that the left-hand side is now the derivative of the product of two functions with respect to \(x\), which allows us to rewrite the equation as:
\[
\frac{d}{dx}\left(e^{\frac{1}{2}x^2 - x}Ky\right) = e^{\frac{1}{2}x^2 - x}K \cdot 2
\]
Now, integrate both sides with respect to \(x\):
\[
\int \frac{d}{dx}\left(e^{\frac{1}{2}x^2 - x}Ky\right) dx = \int e^{\frac{1}{2}x^2 - x}K \cdot 2 dx
\]
Using the fundamental theorem of calculus on the left-hand side:
\[
e^{\frac{1}{2}x^2 - x}Ky = 2K \int e^{\frac{1}{2}x^2 - x} dx
\]
Now, integrate the right-hand side:
\[
e^{\frac{1}{2}x^2 - x}Ky = 2K \cdot \int e^{\frac{1}{2}x^2 - x} dx
\]
This integral doesn't have a simple elementary antiderivative, so it is typically represented in terms of the error function (\(\text{erf}\)):
\[
\int e^{\frac{1}{2}x^2 - x} dx = \sqrt{\frac{\pi}{2}}\text{erf}\left(\frac{x}{\sqrt{2}} - 1\right) + C
\]
Now, we can substitute this result back into our equation:
\[
e^{\frac{1}{2}x^2 - x}Ky = 2K \cdot \left(\sqrt{\frac{\pi}{2}}\text{erf}\left(\frac{x}{\sqrt{2}} - 1\right) + C\right)
\]
Now, divide both sides by \(e^{\frac{1}{2}x^2 - x}K\):
\[
y = 2 \sqrt{\frac{\pi}{2}}\text{erf}\left(\frac{x}{\sqrt{2}} - 1\right) + C
\]
Now, apply the initial condition \(y(0) = 0\):
\[
0 = 2 \sqrt{\frac{\pi}{2}}\text{erf}\left(-\frac{1}{\sqrt{2}}\right) + C
\]
Solve for \(C\):
\[
C = -2 \sqrt{\frac{\pi}{2}}\text{erf}\left(-\frac{1}{\sqrt{2}}\right)
\]
So, the solution to the initial value problem is:
\[
y(x) = 2 \sqrt{\frac{\pi}{2}}\text{erf}\left(\frac{x}{\sqrt{2}} - 1\right) - 2 \sqrt{\frac{\pi}{2}}\text{erf}\left(-\frac{1}{\sqrt{2}}\right)
\]
Explanation: