I think the problem you're having is not fully figuring out your solution before diving in and coding it. You have a differential equation of the form
where are constants. This equation is valid on the domain . It's easy enough to solve by integrating directly
You can figure out what is from the boundary condition (all the other terms go away when ). If you think of it this way and define the various constants in terms of the physical parameters, it's a bit easier to see what's going on - all of the parameters "get in the way" and make the expressions look overcomplicated.
So that's the mathematical part, which is pretty straightforward. The problem is relating it to your picture -- what are we looking at? What is the actual geometry of a problem? Where is the force being applied? The picture doesn't look like a cantilevered beam.