For starters, the constant pi is written as Pi in Maple.

The online help for pdsolve is not very complete. But, it appears it's possible to provide IC and/or BC only when you are looking for a numeric solution.

But, we can apply the IC and BC by hand to find the analytic solution:

PDE := diff(u(x,t),t)=1/2*diff(u(x,t),x,x);
IBC := {u(x,0)=T0, u(0,t)=0, u(d,t)=0};
vals := {a=1/2, T0=0.1*sin(x), d=Pi};
d 1 d / d \
--- u(x, t) = - --- |--- u(x, t)|
dt 2 dx \ dx /
{u(0, t) = 0, u(d, t) = 0, u(x, 0) = T0}
/ 1 \
{ T0 = 0.1 sin(x), a = -, d = Pi }
\ 2 /
PDE2 := eval(PDE,vals);
IBC2 := eval(IBC,vals);
d 1 d / d \
--- u(x, t) = - --- |--- u(x, t)|
dt 2 dx \ dx /
{u(0, t) = 0, u(Pi, t) = 0, u(x, 0) = 0.1 sin(x)}

Let Maple find the general form of the solution, and build the solution from these pieces:

sol := pdsolve(PDE2,build);
/1 \
_C3 exp|- _c[1] t| _C2
/ (1/2) \ /1 \ \2 /
u(x, t) = exp\_c[1] x/ _C3 exp|- _c[1] t| _C1 + ----------------------
\2 / / (1/2) \
exp\_c[1] x/

To begin to apply the BC, let's make the solution into a function:

U := unapply( rhs(sol), (x,t) );
/1 \
_C3 exp|- _c[1] t| _C2
/ (1/2) \ /1 \ \2 /
(x, t) -> exp\_c[1] x/ _C3 exp|- _c[1] t| _C1 + ----------------------
\2 / / (1/2) \
exp\_c[1] x/
eq1 := U(0,t)=0;
/1 \ /1 \
_C3 exp|- _c[1] t| _C1 + _C3 exp|- _c[1] t| _C2 = 0
\2 / \2 /
eq2 := U(Pi,t)=0;
/1 \
_C3 exp|- _c[1] t| _C2
/ (1/2) \ /1 \ \2 /
exp\_c[1] Pi/ _C3 exp|- _c[1] t| _C1 + ---------------------- = 0
\2 / / (1/2) \
exp\_c[1] Pi/

We want Maple to solve these two equations, finding solutions that are valid for all values of t:

solve( {identity(eq1,t),identity(eq2,t)} );
/ 2 \
{ / / (1/2) \\ }
\_C1 = _C1, _C2 = -\exp\_c[1] Pi// _C1, _C3 = 0, _c[1] = _c[1]/ ,
{_C1 = 0, _C2 = 0, _C3 = _C3, _c[1] = _c[1]},
{_C1 = _C1, _C2 = -_C1, _C3 = _C3, _c[1] = 0},
{_C1 = _C1, _C2 = -_C1, _C3 = _C3, _c[1] = -1}

Only one of these leads to a nontrivial solution

sol2 := eval( sol, %[4] );
/ 1 \
_C3 exp|- - t| _C1
/ 1 \ \ 2 /
u(x, t) = exp(I x) _C3 exp|- - t| _C1 - ------------------
\ 2 / exp(I x)

Now, turning to the IC:

U2 := unapply( rhs(sol2), (x,t) );
/ 1 \
_C3 exp|- - t| _C1
/ 1 \ \ 2 /
(x, t) -> exp(I x) _C3 exp|- - t| _C1 - ------------------
\ 2 / exp(I x)
eq3 := U2(x,0)=sin(x)/10;
_C3 _C1 1
exp(I x) _C3 _C1 - -------- = -- sin(x)
exp(I x) 10
solve( identity(eq3,x) );
/ 1 \
| -- I |
< 20 >
|_C1 = - ----, _C3 = _C3|
\ _C3 /
sol3 := eval( sol2, % );
1 / 1 \
-- I exp|- - t|
1 / 1 \ 20 \ 2 /
u(x, t) = --- I exp(I x) exp|- - t| + ---------------
20 \ 2 / exp(I x)

We want to convert the complex exponentials in x into trig functions - without changing the exponential in t. If we try to use convert, this will apply to all parts of the expression (x and t). While there's probably a way this can be done, I feel like doing some Maple surgery. Let's pull out all of the terms that involve x:

X := select( has, rhs(factor(sol3)), x );
(exp(I x) + 1) (exp(I x) - 1)
-----------------------------
exp(I x)
convert( X, trig );
(cos(x) + I sin(x) + 1) (cos(x) + I sin(x) - 1)
-----------------------------------------------
cos(x) + I sin(x)
XX := simplify( % );
2 I sin(x)

Now, rewrite the solution using this expression for the spatial terms:

simplify( rhs(sol3)/X*XX );
1 / 1 \
-- exp|- - t| sin(x)
10 \ 2 /

Very nice. Exactly the solution I could have written down from the beginning if I had just stopped to think.

I will add that I had originally hoped to be able to apply the BC and IC simultaneously, but Maple was not helpful when I tried:

eq3a := U(x,0)=sin(x)/10;
/ (1/2) \ _C3 _C2 1
exp\_c[1] x/ _C3 _C1 + ----------------- = -- sin(x)
/ (1/2) \ 10
exp\_c[1] x/
solve( {identity(eq1,t),identity(eq2,t),identity(eq3a,x)} );
Warning, solutions may have been lost

Doug

---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu