# Solving an equation for a variable

Sal solves the equation P=2I+2w for the variable I. Created by Sal Khan and Monterey Institute for Technology and Education.
Video transcript
Solve P equals 2l plus 2w for l. So this right here, this is just the formula for the perimeter of a rectangle. Perimeter is equal to 2 times the length plus 2 times the width. But they just want us to solve this equation right here, solve for l. So let's do that. So we have P is equal to 2 times l plus 2 times w. So we need to solve for l. So let's isolate all of the l terms on one side. And the best way, we could just do that by leaving it here on the right and then getting rid of this 2w. And the best way to get rid of this 2w is to subtract it from the right. But if you're going to subtract it from the right, you also have to subtract it from the left if you want this equality to hold. So you have to also subtract it from the left. And so the left-hand side becomes P minus 2w. And the right-hand side, you get-- this 2w minus 2w cancels out. You just have a 2l. And then if you want to solve for l, you just have to divide both sides of this equation by 2. You just divide both sides of this equation by 2. And we have isolated our l. We get l is equal to P minus 2w over 2. Or if we wanted to write it the other way, you could write l is equal to P minus 2w over 2. And we are done.