Does [tex]\nabla ^2 u(r,\theta) = 0 [/tex] with the boundary conditions [tex]u(1,\theta) = u(2,\theta) = \sin^2 \theta [/tex] have any solutions? This was a problem on my exam but someone must have written the conditions wrong, or am I stupid?
Why not? It's a well-defined, well-behaved boundary condition over an enclosed space (the region between two concentric spheres). The general solution in spherical coordinates is sum (Ai r^i + Bi / r^(i+1))Pi(cos theta). Plug in r=1 and r=2, and rewrite the sin^2 theta as 1 - cos^2 theta... then you only need the first few Legendre polynomials and you can solve for the coefficients.
Ah, right, sorry, I'm used to looking at these things in spherical coordinates... oh well, same wine, different bottle. The general solutions look like A0 ln r + B0 + sum (Ai r^i + Bi / r^i)(Ci cos (i theta) + Di sin (i theta)). Use the double angle formula to get your cos^2 term.
How am I ever gonna get [tex]u(2,\theta)[/tex], wich contains an [tex]ln 2[/tex], to equal [tex]\sin^2 \theta[/tex]? And how can you possibly write [tex]\sin^2 \theta[/tex] as a linear combination of sin and cos?
You aren't. Better set A0 = 0. And arildno already answered your other question. Basically, you are free to choose any combination of the coefficients you need to match the boundary conditions. There are some integrals you can do to solve this analytically, but in most cases that you are likely to see in homework or on a test, you can just pick out the coefficients by inspection.