Separation of Variables
Assuming V(x,y) = X(x)·Y(y) and hoping for the best — here's how separation of variables lets us crack Laplace's equation step by step!
Previously we learned image method, one of the ways to solve Laplace’s equation (a trick).
Well, you could call it a skill,
and now I’ll introduce another skill called separation of variables.
In the method of separation of variables, you assume the function V is in the form of (a function of x) times (a function of y), and then solve it.
So it’s something that depends on luck.
What if you assume this and try to solve the problem, but it doesn’t work out????

Well, that would mean the V function couldn’t be separated like that, I guess haha
Let’s get started.
Let’s assume V(x,y) = X(x)·Y(y).
If you plug the assumed V(x,y) = X(x)·Y(y) into Laplace’s equation,

For two terms with different variables to add up to zero, both terms must be constants!!
If anyone has any objection to the claim that for (a function of x) + (a function of y) to be a constant, each function must be a constant, I’d be happy to hear it out^^
Let’s call the constant k^2…. (the reason for squaring it is to make the calculation easier haha you’ll catch on later)

You differentiate “something” twice,
and to get “something” back, that something has to be of the form e to the x power (exponential) or a trigonometric function (sine or cosine).
(The details are covered in differential equations ~http://gdpresent.blog.me/220341671707)

Differential equations special post.
If you’re an undergraduate in STEM, I’m going to write a post about “(linear) differential equations,” which you’ll encounter a freakin’ ton of….
gdpresent.blog.me
Anyway, if we write out the general solution,

We make the general solution like this, and then plug in boundary conditions one by one to find the coefficients A, B, C, D, k!!! hahaha fun, right!!
Let’s try solving an example problem.

Let’s try using separation of variables with boundary conditions like this!!!
Since we did it in 2D, I brought a problem that asks for V(x,y) in 2D!
Should we write the boundary conditions first?
V(x,0) = 0
V(x,a) = 0
V(∞,y) = 0
V(0,y) = V_0(y)
Now let’s plug those in one by one~~~~
From boundary condition 1, D=0
From boundary condition 2, Csin(ky) = 0 ☞ ∴k=nπ/a
From boundary condition 3, A=0
That’s as far as we can get. In the end we couldn’t determine the constants B and C.
Let’s go determine them!
First, if we write V by applying the constants we’ve determined so far,

Now you see why we expressed the general solution of X as an exponential and that of Y as a trigonometric function, right?
If X had been a trig function, we wouldn’t have been able to make V=0 at a very far location,
and if Y had been exponential, we wouldn’t have been able to make V=0 at y=a and y=0.
(And we also need the condition n≠0, but I forgot to mention it..haha)
And the reason I restricted n to be positive is that the sign of k flips back and forth, so I picked either plus or minus!!!
(It doesn’t matter if you pick minus either.)
Anyway, that’s how we got the general solution of V.
How many general solutions of V are there?? A whole lot…
The differential equation we dealt with is a linear differential equation, so it also satisfies linear combinations!!! (a sum of solutions is also a solution!)
Let’s take a linear combination and express multiple solutions as one solutionnn~
(If you want the detailed version, please refer to the linear algebra post^^ scheduled for June 2015^^)

Now if we plug boundary condition 4, which didn’t get used before, into that general solution,

Now how are we going to cook up this equation. We’re going to deploy a kind of technique — a purely mathematical knack called Fourier’s trick.
We’re going to multiply both sides by sin(n’πy/a) and make a term that integrates from 0 to a
(Fourier’s trick is used a lot not just in electromagnetism but also in thermal/statistical mechanics, quantum mechanics, etc.)

Now the left-hand side has the value (a/2) only when n=n’, and in all other cases it’s 0. So the left-hand side becomes
0+0+0+0+0+Cn(a/2)+0+0+0+ ···················· like this, and as a result
we can determine the constant Cn.

<Functions whose inner product is 0 are said to be orthogonal to each other. (When you view functions as vectors, the inner product is an integral.)>
Even if you don’t know that they’re orthogonal, you can just notice from integrating that everything is alllll 0 except n=m, so don’t worry about it.
(In linear algebra, inner products of vectors other than spatial vectors are covered.)
Let’s solve one more Laplace equation problem in 3D

Let’s try with boundary conditions like this. Let’s write out the boundary conditions first~
Just by looking at the picture you can immediately catch that x should be in exponential form and y, z should be in sine function form.
y=0 → V=0
y=a → V=0
z=0 → V=0
z=b → V=0
x→∞ → V=0
x=0 → V=V(y,z)

We got the general solution of V(x,y,z).

Let’s plug in the boundary conditions one by one.
From boundary condition 1, D=0
From boundary condition 2, Csin(ky)=0, so k=nπ/a
From boundary condition 3, F=0
From boundary condition 4, Esin(lb)=0, so l=mπ/b
From boundary condition 5, A=0

Now if we plug the last boundary condition in here!!!!!

If we go-go-sing go-go-sing Fourier’s trick separately for y and for z

And this way we found all the constants~~~~ If V0(y,z) happens to be a function that doesn’t depend on y, z,
then the next step of integration is at a high school level, so you can do it easy-peasy!
The first time I did this I was like wow….. what is this?…
but if you sit down caaaalmly and follow along step by step, it turned out not to be that hard~
This was the midterm scope for me~
Studying like this, I scored the highest grade~ clap clap clap clap~~
I need to keep studying hard going forward! haha

Originally written in Korean on my Naver blog (2014-11). Translated to English for gdpark.blog.