Interestingly, just BEFORE Matthew's account of the disciples' inability to cast out a demon, Jesus had sent them on a "gospel training mission" to some cities. Before they left Jesus gave them the authority to heal the sick, raise the dead and cast out demons wherever they went (Matthew 10:5 - 15).
Another interesting thing to note is that initially the demon in Matthew 17 could not be cast out not only due to a lack of faith on the part of the disciples but also the FAITHLESSNESS of those around the demonically-possessed person, as Jesus said 'O FAITHLESS and perverse generation . . .' (Matthew 17:17). It was only after the disciples failed and the crowd was chided for their faithlessness that Jesus rebuked the demon.
These scriptures warn us that just because someone (including ourselves) believe in Jesus or uses Jesus' name does not mean they (or we) have the faith and authority from God to cast out evil spirits. Casting out demons is serious business and not to be taken lightly. Anyone taking on themselves the driving out of these spirits had better be well grounded in the scriptures and have an ample portion of God's Holy Spirit! Those who wrongly ASSUME they have the power and authority to cast out demons can suffer some very real painful consequences, as seven sons mentioned in the New Testament found out. They tried to claim power over a demon by saying 'I command you in the name of Jesus, whom Paul preaches.' (Acts 19:13). The spirit was not amused. It caused the man it possessed to attack the men and wound them (verse 16)!
Those who were claiming the ability to cast our demons were sons of a Levite chief priest. Because of this, they must have thought of themselves as being pretty important and powerful, certainly powerful enough to simply assume they could use the name (authority) of Jesus Christ (after only hearing of Him through the apostle Paul) to command obedience from fallen angels.
There was, however, one problem. These men believed all they needed to do was use Jesus' name, kind of like a magician who says some "magic words" before a trick like ABRACADABRA, and then, PRESTO, what they wanted to happen would occur! The problem was the demon(s) they were trying to cast out of a person KNEW the true power it took to FORCE them to leave and KNEW these men were ultimately only PRETENDING that they had it! Ironically, the men trying to act like they were God were in reality DECEIVED, while those whose existence was based entirely on DECEPTION (demons) knew what was the REAL truth!
Those who saw or heard of what happened quickly learned not to take the name and authority of Jesus Christ lightly --- and especially not to ASSUME they had God's authority to do whatever they pleased. If God has not ordained you to use His name for casting out demons, do not think you can simply conjure up some faith and do it anyway. Based on the Bible, it will not work!