Years ago I had a 50HP on the back of a boat rated for 100HP (16').
With me and maybe my lightest kid on board, after a little runup, the 50 would get it on plane. But think "following sea, tail wind and boating downhill" to make it happen. Most of the time we were just a barge "putting" here and "putting" there.
If you're not going long distances, or don't mind just lumbering your way around, it's not bad at all; kind of a nice lazy ride. If you're in a hurry ... you're gonna' hate it.
The only addition that I'll toss in: my boat was pretty light and the 50 did fine maneuvering. BUT, with just a 40HP on your boat, depending on the weight you could wind up with a fight getting it to go where you want in windy or choppy conditions. You'll have to test that out some on a calmer day ... see how confident you are that the 40 maneuver you around. It'll push it (just like a kicker motor would, and better), but controlling it in weather might be another fight.
Welcome aboard.