Step 1: Rewrite the given differential equation
Rearrange the equation to separate variables:
\[
\frac{dy}{dx} = x e^{y/x} + \frac{y}{x}
\]
This is a homogeneous differential equation.
Step 2: Substitution
Let:
\[
y = v x \quad \Rightarrow \quad \frac{dy}{dx} = v + x \frac{dv}{dx}
\]
Substitute \( y = v x \) into the equation:
\[
v + x \frac{dv}{dx} = x e^{v} + v
\]
Simplify:
\[
x \frac{dv}{dx} = x e^{v}
\]
Step 3: Solve for \( v \)
Rearranging for integration:
\[
\int e^{-v} \, dv = \int \frac{1}{x} \, dx
\]
Evaluating the integrals:
\[
-e^{-v} = \log |x| + C
\]
Substitute \( v = \frac{y}{x} \):
\[
-e^{-\frac{y}{x}} = \log |x| + C \quad \dots \text{(1)}
\]
Step 4: Apply the initial condition
Given \( y = 1 \) when \( x = 1 \). Substitute these values into equation (1):
\[
-e^{-1} = \log |1| + C
\]
Since \( \log |1| = 0 \):
\[
-e^{-1} = C
\]
Thus:
\[
C = -e^{-1}
\]
Step 5: Substitute \( C \) back into the solution
Substitute \( C = -e^{-1} \) into equation (1):
\[
-e^{-\frac{y}{x}} = \log |x| - e^{-1}
\]
Rearranging:
\[
\log |x| + e^{-\frac{y}{x}} = e^{-1}
\]
Final Answer:
\[
\boxed{\log |x| + e^{-\frac{y}{x}} = e^{-1}}
\]