# Check if an expression is the solution of a PDE problem?

GROUPS:
 I have deduced a solution eq16 from the PDE problem eq13, eq14 and eq15. Now I want to examine if eq16 is the right solution. The examinations eq17, eq18 and eq19 show that eq16 can't satisfy eq13 and eq14. But I think eq16 should be right one. Please help me with checking the examination. Thanks. eq12 = (cinf \[Theta]c \[Lambda])/(s + \[Theta]c) - ( E^((lh - x) /Sqrt[Dc ] Sqrt[s + \[Theta]c]) F1 Sqrt[ Dc ] \[Lambda])/ Sqrt[ (s + \[Theta]c)] /. {Sqrt[Dc] F1 \[Lambda] -> A1, cinf \[Theta]c \[Lambda] -> A2} (*equation.*) eq13 = s *q[x, s] - Dp*D[q[x, s], {x, 2}] - pinf + eq12 == 0 (*left boundary condition.*) eq14 = \[Alpha]1*(q[x, s] /. x -> lh) - (D[q[x, s], x] /. x -> lh) == 0 (*right boundary condition.*) eq15 = (D[q[x, s], x] /. x -> +\[Infinity]) == 0 (*a solution to be examined.*) eq16 = (-A2 + pinf (s + \[Theta]c))/(s (s + \[Theta]c)) - ( A1 Dc E^((lh - x) Sqrt[(s + \[Theta]c)/ Dc]) (\[Alpha]1 Sqrt[Dp (s + \[Theta]c)] + Sqrt[ s (s + \[Theta]c)]))/((Sqrt[s] + Sqrt[Dp] \[Alpha]1) (s + \[Theta]c) (-Dc s + Dp (s + \[Theta]c))) + (E^((s (lh - x))/Sqrt[ Dp s]) (Sqrt[ Dp] \[Alpha]1 (Dc s - Dp (s + \[Theta]c)) (-A2 + pinf (s + \[Theta]c)) + A1 s (Sqrt[Dc Dp] s + Sqrt[Dc Dp] \[Theta]c + Dc \[Alpha]1 Sqrt[Dp (s + \[Theta]c)])))/(s (Sqrt[s] + Sqrt[Dp] \[Alpha]1) (s + \[Theta]c) (-Dc s + Dp (s + \[Theta]c))) (*examine eq16.*) q1[x_, s_] := eq16 eq17 = FullSimplify[ eq14 /. {q -> (q1[#1, #2] &)}, (lh - x) < 0 && s > 0 && s + \[Theta]c > 0 && Dp > 0 && Dc > 0 && \[Alpha]1 > 0] // Normal eq18 = FullSimplify[ eq15 /. {q -> (q1[#1, #2] &)}, (lh - x) < 0 && s > 0 && s + \[Theta]c > 0 && Dp > 0 && Dc > 0 && \[Alpha]1 > 0] // Normal eq19 = FullSimplify[ eq15 /. {q -> (q1[#1, #2] &)} 
 Gianluca Gorni 1 Vote The problem is the delayed definition q1[x_, s_] := eq16. If you give immediate definition q1[x_, s_] := eq16 you get what you expected. It is tricky. Here is a simple example: expression = x^2; q1[x_] := expression; q[y] /. q -> q1 The output is x^2, not y^2, as you might expect. You avoid this kind of trap with a less convoluted code: q1[x_] := x^2; q[y] /. q -> q1 
 Ok, I get it. Thanks. In[536]:= Clear[q1, q2, q3, q4, q5, q6]; In[537]:= expression = x^2; q1[x_] := expression; q2[y] /. q2 -> q1 Out[539]= x^2 In[540]:= q3[x_] = expression; q4[y] /. q4 -> q3 Out[541]= y^2 In[542]:= q5[x_] := x^2; q6[y] /. q6 -> q5 Out[543]= y^2