Since bb is fairly simple, you can substitute that into sms. Then, solving gives something nice. However, you have to tell Sage some information about a.
var("x,L,a")