Both equations are linear, so I'll use the integrating factor method.
The first ODE

has integrating factor

In the original equation, multiply both sides by eˣ :

Observe that
d/dx [xeˣ] = eˣ + xeˣ = (x + 1) eˣ
so that the left side is the derivative of a product, namely

Integrate both sides with respect to x :


Solve for y :

Use the given initial condition to solve for C. When x = 1, y = 2, so

Then the particular solution is

The second ODE

has integrating factor

Multiply both sides of the equation by 1/(1 + x²) :

and observe that
d/dx[1/(1 + x²)] = -2x/(1 + x²)²
Then



When x = 0, y = 3, so

