Link to Luther's Rogate Sermon -
3. In the third place, if one prays doubting that God will hear him, and only offers his prayers as a venture, whether it be granted or not granted, he is guilty of two wicked deeds. The first is, that he, himself, makes his prayer unavailing and he labors in vain. For Jesus says: “Whoever will ask of God, let him ask in faith, nothing doubting: for he that doubteth is like the surge of the sea driven by the wind and tossed. For let not that man think that he shall receive anything of the Lord.” James 1:6-7. He means that the heart of such a man does not continue stable, therefore God can give it nothing; but faith keeps the heart calm and stable and makes it receptive for the divine gifts.
4. The other wicked deed is, that he regards his most true and faithful God as a liar and an unstable and doubtful being; as one who can not or will not keep his promise; and thus through his doubt he robs God of his honor and of his name of truth and faithfulness. In this, such a grievous sin is committed that by this sin a Christian becomes a heathen, denying and losing his own God, and thus he remains in his sin, and must be condemned forever, without comfort. Moreover, if he receives that for which he prays, it will be given, not for his salvation, but for his punishment in time and eternity and it is not for the sake of the prayers, but because of his wrath that God rewards the good words which were spoken in sin, unbelief and divine dishonor.