How to fix this crack in drywall?
Put an expansion joint in the same location as the crack or remove the drywall and replace it but change the layout so there isn't a seam there. It's common to get cracks at doors like this, so when drywalling the professionals try not to put seams that close to either end of a door for that reason. 

You can retape this as is with paper or mesh tape and joint compound, but the crack always comes back. If you go this route, trying not to slam this door will help the repair last longer.