Utility Function

Univariate Function

Plot[x^(1/3), {x, 0, 2}]

\(Plot[x^\((1/3)\), {x, 0, 2}, 
\ \ \ \ \ \ AxesLabel -> {x, u}, 

      \ \ \ \ \ \ GridLines -> Automatic, 
\ \ \ \ \ \ AspectRatio -> 0.7, 

      \ \ \ \ \ \ PlotStyle -> {Thickness[0.006]}]\)

D[x^(1/3), x]

u[x_] := x^(1/3);

u' (x)

\(sessenn[a_] := 
      Module[{u}, u[x_] := x^\((1/3)\); 
		
        Plot[{u[x], \(u'\)[a]\ \ \((x - a)\)\  + \ u[a]}, {x, 0, 4}]]\)

sessenn[1.3]

Plot[{u[x], u'[x], u''[x]}, {x, 0.001, 2}, 
      PlotRange -> {-3, 3}]

Bivariate Function

v[x1_, x2_] := x1^(1/3) x2^(2/3)

Plot3D[v[x1, x2], {x1, 0, 4}, {x2, 0, 4}, BoxRatios -> {1, 1, 0.75}, 
      AxesLabel -> {x1, x2, v}, ViewPoint -> {-4, -2, 0.75}]

Plot3D[v[x1, x2],{x1, 0, 4},{x2, 0, 4},BoxRatios->{1,1,0.75`},AxesLabel -> {x1, x2, v},ViewPoint -> {-4, -2, 0.75`},PlotPoints -> 20]

ContourPlot[v[x1, x2], {x1, 0, 4}, {x2, 0, 4}]

v[x1_, x2_] := x1  x2^2

Plot3D[v[x1, x2], {x1, 0, 4}, {x2, 0, 4}, BoxRatios -> {1, 1, 0.75}, 
      AxesLabel -> {x1, x2, v}, ViewPoint -> {-4, -2, 0.75}]

Plot3D[v[x1, x2],{x1, 0, 4},{x2, 0, 4},BoxRatios->{1,1,0.75`},AxesLabel -> {x1, x2, v},ViewPoint -> {-4, -2, 0.75`},PlotPoints -> 20]

ContourPlot[v[x1, x2], {x1, 0, 4}, {x2, 0, 4}]

Utility Maximization (bivariate case)

Solve[p1 x1  +  p2 x2  ==  m, x2]

x2b[p1_, p2_, m_, x1_] := (m  -  p1  x1)/p2

v1[x1_, p1_, p2_, m_] := v[x1, x2b[p1, p2, m, x1]]

Plot[v1[x1, 2, 3, 10], {x1, 0, 5}]

maxx = Solve[D[v1[x1, p1, p2, m], x1] == 0, x1]

x2b[p1, p2, m, x1] /. maxx[[1, 1]] // Simplify

x1 /. maxx[[1, 1]]

x1 /. maxx[[1, 1]] /. {m -> 10, p1 -> 2}