To solve the differential equation \( e^x y dx + e^x dy + x dx = 0 \), we can follow these steps:
Given Differential Equation:
\[
e^x y dx + e^x dy + x dx = 0
\]
Step 1: Rearrange the Equation
Combine like terms:
\[
e^x y dx + x dx + e^x dy = 0
\]
Factor out \( dx \):
\[
(e^x y + x) dx + e^x dy = 0
\]
Step 2: Check for Exactness
A differential equation of the form \( M dx + N dy = 0 \) is exact if \( \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} \).
Here, \( M = e^x y + x \) and \( N = e^x \).
Compute the partial derivatives:
\[
\frac{\partial M}{\partial y} = e^x
\]
\[
\frac{\partial N}{\partial x} = e^x
\]
Since \( \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} \), the equation is exact.
Step 3: Find the Potential Function
Integrate \( M \) with respect to \( x \):
\[
\int (e^x y + x) dx = y e^x + \frac{x^2}{2} + h(y)
\]
Differentiate this result with respect to \( y \) and set it equal to \( N \):
\[
\frac{\partial}{\partial y} \left( y e^x + \frac{x^2}{2} + h(y) \right) = e^x + h'(y)
\]
Set this equal to \( N \):
\[
e^x + h'(y) = e^x
\]
Thus, \( h'(y) = 0 \), so \( h(y) \) is a constant.
Step 4: Write the General Solution
The potential function is:
\[
y e^x + \frac{x^2}{2} = C
\]
Multiply through by 2 to eliminate the fraction:
\[
2 y e^x + x^2 = 2C
\]
Let \( c = 2C \), then:
\[
2 y e^x + x^2 = c
\]
Final Answer:
\[
\boxed{2 y e^x + x^2 = c}
\]
This corresponds to option (2).