IPhone, iPad or any other device is never free of any problems, in this case going to focus me to do when the power button has decided to stop working, it's not a very common problem but when it appears is really worrying .
The solution is to locate the power button on the screen, turn it into a touchscreen button. To do this you must do the following.
Follow this trail on your iPad or iPhone Settings> General> Accessibility.
Then a new menu will appear, scroll to the bottom and select AssitiveTouch.
Activate the switch AssistiveTouch .Inmediatamente you a square icon on a translucent screen iPad or iPhone should appear.
Tap on the icon translucent, like a new menu with four options selected, Siri, device and Home,
Well, now click on the Device option and you see a new window with options.
As it is logical to click on Lock Screen to perform the action.
Now you have locked the screen of your iPhone or iPad, as when you press the power button.
To unlock do not need the power button, you can turn to click on the start button.
This solution will always serve the iPhone or the iPad does not turn off, if it will not be difficult for us to turn it back on. If I'm not mistaken the only way to do so is to connect it to your Mac with iTunes.
To return to normal you're gonna get a technician to service and checkout, while a convenient solution and do not spend a dime.