# Derivative at the point

How can I get a derivate at the point? I've specifyed a boundary condition for my PDE:

  lb = - c D[u[x, t], x][a, t] + d u[a, t] == gamma


When I present the function as

a = 0;
c = 1; d= 3;
u[x_, t_] = f[x, t] w[x]
f[x_, t_] = E^(-k t) + 1;
k = 5;
w[x_] = x^2 Cos[x];


and try to express the right part:

Solve[lb, gamma]


I get

{{gamma -> -(2 (1 + E^(-5 t)) x Cos[x] - (1 + E^(-5 t)) x^2 Sin[
x])[0, t]}}


So, variables x and t are still free. But I want Mathematica to substitute x=0 , t=t and get {gamma ->0} above.

• What do you mean substitute x=0? Have you looked at DSolve[]? Nov 11, 2016 at 14:17
• No, this is no ODE. I'll use gamma gotten above to simulate the solution I've pointed explicitly. I just take a derivate here , nothing more. Nov 11, 2016 at 14:20

a = 0;
c = 1;
d = 3;
k = 5;
f[x_, t_] = E^(-k t) + 1;
w[x_] = x^2 Cos[x];
u[x_, t_] = f[x, t] w[x];


I don't understand what you mean by the notation D[u[x, t], x][a, t] in the definition of lb. Since D[u[x, t], x] is not a pure function, it does not take arguments. Assuming that the definition of lb should read

lb = -c D[u[x, t], x] + d u[a, t] == gamma

(*  -2 (1 + E^(-5 t)) x Cos[x] + (1 + E^(-5 t)) x^2 Sin[x] == gamma  *)

soln = Solve[lb, gamma][[1]] // Simplify

(*  {gamma -> E^(-5 t) (1 + E^(5 t)) x (-2 Cos[x] + x Sin[x])}  *)

lb /. soln // Simplify

(*  True  *)


lb = -c (D[u[x, t], x] /. x -> a) + d u[a, t] == gamma

(*  0 == gamma  *)


Alternatively, you can write the derivative as

lb = -c Derivative[1, 0][u][a, t] + d u[a, t] == gamma

(*  0 == gamma  *)

• As I understand the question, the last line is what the OP is looking for. Nov 11, 2016 at 15:10
• Thank you. Replace /. is what I need. Nov 11, 2016 at 15:14