And this:
g[x_] := ArcTan[x]^2 + ArcSin[x/2];
dg[x_] = D[g[x], x];
p1 = Plot[{g[x], dg[x]}, {x, -2, 2}, PlotLegends -> "Expressions",
Epilog -> {PointSize[0.02], Point[{1, g[1]}]}]
In[4]:= (* dg[x_]= was used rather than dg[x_]:= because we want the \
right hand side evaluated before the rule is defined. Look up Set and \
SetDelayed. *)
In[5]:= (* = would work here as well, but := is used more often *)
f[x_] := 3 x + 1; (* defines a function *)
In[6]:= f[a] (* evaluates it at a *)
Out[6]= 1 + 3 a
In[7]:= f[1]
Out[7]= 4