here is the problem: $$(3t^2x-1+x^2)dt+(t^3+2tx)dx=0$$
I got stuck at the point where the derivatice of $C(x)$ needs to be found.
$$P = 3t^2x-1+x^2, Q=t^3+2tx$$
$$\frac{\partial P}{\partial x}=3t^2+2x; \frac{\partial Q}{\partial t}=3t^2+2x \Rightarrow \frac{\partial P}{\partial x}=\frac{\partial Q}{\partial t}$$
$$\frac{\partial u}{\partial t}=P(t,x) \Rightarrow u=\int P(t,x)dt + C(x)$$
$$u=\int (3t^2x-1+x^2)dt + C(x) = t^3x-t + x^2t + C(x)$$
$$\frac{\partial u}{\partial x}=Q(t,x), \frac{\partial u}{\partial x}= t^3+2tx+C'(x)$$
$$C'(x)= 0 $$
$$C(x) = x$$
$$u(t,x)=t^3x-t+x^2t+x$$
I don't know how to express $C(x)$ from here because it seems that it will contain both $x$ and $t$. Can someone help? Also Why is C dependant on $x$ instead of $t$?
Define $$\frac{\partial P(t,x)}{\partial x}=3t^2+2x=\frac{\partial Q(t,x)}{\partial t}$$ defining $f(t,x)$ such that $$\frac{\partial f(t,x)}{\partial t}=P(t,x)$$ and $$\frac{\partial f(t,x)}{\partial x}=Q(t,x)$$ and the solution will given by $$f(t,x)=c_1$$ $$f(t,x)=\int x^2+3xt^2-1dt=-t+t^3x+tx^2+g(x)$$ then differentiating $$\frac {\partial f(t,x)}{\partial x}=t^3+2tx+\frac{d g(x)}{dx}$$ so $$\frac{d g(x)}{dx}=0$$ we get $$f(t,x)=-t+x^2t+xt^3$$ Now substitute $$f(t,x)=c_1$$ and solving for $x(t)$
we get $$x(t)=\frac{-t^3-\sqrt{t}\sqrt{t^5+4t+4c_1}}{2t}$$ $$x(t)=\frac{-t^3+\sqrt{t}\sqrt{t^5+4t+4c_1}}{2t}$$