At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
it is non homogenous so I think you use solve it as a steady state separation of variables?
i don't know how to do it with the cost
I think it can be done that way.
So since it's non homogenous, assume u(x,t)= v(x) + w(x,t)
Take the partials of your assumption so you can plug back into your pde. So plugging it back in, you get 1. dw/dt=K(v(x)'' + K(d2w/dx2). Now you plug in your boundary conditions from the question into your assumption. So 2. v(0)+w(0,t)=0, v(pi)+w(pi,t)=picost and 3. v(x)+ w(x,0)=x. Now let t-> infinity, so all of w(x,t) and its derivatives of 0. Using this to simplify our newly attained equations, we learn that:
0=v''(x) and v(0)=0, v(pi)=picost. Integrate v'' twice to solve for v(x). v(x)=c1x+c2. Plug in v(0)=0, v(pi)=picost to solve for the constants. C2=0 and C1=cost. Now you have v(x). Now plug in the values for v(x) to simplify the 3 equations i labelled back there. You will get: 1. dw/dt=Kd2w/dx2, 2. w(0,t)=0, w(pi,t)=0 (the cost is gone because v(pi)=picost so subtracting from both sides you get w(pi,t)=0), w(x,0)=x-xcost. With these new BC, the pde is now homongeous. Now you can solve this new pde as a normal separation of variables going through eigenfunctions etc. I think you can use this method, but I'm not 100% sure as I said before. This is the furtherest type of pde I know how to solve so yeah haha