3

I've this differential form:

w = (e^y + z*e^x)dx + ((x + 1) e^y + e^z)dy + ((y + 2) e^z + e^x)dz

It is sure exact, so I'm trying to find a primitive of w.

Integrate[ (E^y + z*E^x) \[DifferentialD]x + ((x + 1) E^y + E^z) \[DifferentialD]y + ((y + 2) E^z + E^x) \[DifferentialD]z, x, y, z]

The expected result is (x+1)e^y + y*e^z + e^x*z + z*e^z, but Mathematica gives me a much more complicated result with other integrals... So, what is the correct procedure for finding such integrals?

halirutan
  • 112,764
  • 7
  • 263
  • 474
Teo7
  • 129
  • 5

2 Answers2

5

To solve differential equation you need DSolve or NDSolve, not Integrate. Further, unfortunately, your expected answer is wrong. The correct one you can obtain by:

eq = {D[f[x, y, z], x] == (E^y + z*E^x), 
   D[f[x, y, z], y] == ((x + 1) E^y + E^z), 
   D[f[x, y, z], z] == ((y + 2) E^z + E^x)};
DSolve[eq, f, {x, y, z}]

the simplified result is:

E^y (1 + x) + E^z (2 + y) + E^x z + C[1]
Daniel Huber
  • 51,463
  • 1
  • 23
  • 57
  • See also @bbgodfrey's answer, https://mathematica.stackexchange.com/a/79075, which was updated to include the DSolve solution after V11.3 came out. – Michael E2 Sep 05 '20 at 23:24
5

From my answer to Exact Differentials :

Block[{dx, dy, dz, e = E},
 {dx, dy, dz} = IdentityMatrix[3];
 exactSolve[w, {x, y, z}]
 ]
(*  E^y + 2 E^z + E^y x + E^z y + E^x z  *)

It is convenient to represent w as a vector field, and the base of the natural log/exp function as E.


An alternative, via a path integral from {0,0,0} to {x,y,z}:

Block[{dx, dy, dz, e = E},
 {dx, dy, dz} = Dt@{x, y, z};   (* replace dx... by differentials *)
 With[{df =  w /.
       v : x | y | z :> v*t /.  (* insert parametrization {x t, y t, z t} *)
      Dt /@ (x | y | z) :> 0 /. (* x, y, z are now constants *)
     Dt[t] -> 1},               (* t is the variable of integration *)
  Integrate[df, {t, 0, 1}]
  ]
 ]
(*  -3 + E^y (1 + x) + E^z (2 + y) + E^x z  *)
Michael E2
  • 235,386
  • 17
  • 334
  • 747