A hybrid functions approach for the Duffing equation