Unfortunately, recent versions of Android have deprecated Miracast, which is the open source protocol used for casting your phone or tablet's screen to the TV. If your phone is rooted, there's a hack you can do to re-enable it (apparently the code is still there, it's just disabled). Just search the xda forums for re-enabling Miracast.
What you're supposed to do instead is use one of the stream-forwarding protocol built into certain apps (e.g. video streaming app like YouTube). So instead of decoding the video stream for display on your phone, re-encoding it to a new video stream, and sending that stream to your TV for display, your phone just forwards the original video stream to the TV. Much simpler, less lag, less battery drain...