have a 3 in sch 40 drain line that has frozen 2 times once about 6 inches and once about 24 inches at the exit. it is about 50foot from my home and the water comes from my water softner cleaning itself. Can I put a Heat tape on the end of this pipe to keep it from freezing shut?
Heat tape is not the first thing I'd suggest (I have considerable experience with the stuff, and that makes me avoid it whenever possible.) PVC and heat tape can be a little bit tricky as PVC does not take heat well and also does not conduct heat well, and heat tape is a problem in the long term as it tends to fail and can suck a surprising amount of electricity over its life.
If the pipe is just freezing at the exit (open drain) where it's more shallowly buried, I'd start with digging up about 4-8 feet at the end of the pipe and placing 1" or 2" XPS (Extruded, usually blue or pink styrofoam - the waterproof stuff rated for underground use, not the expanded white stuff that crumbles) over the pipe and reburying. By insulating sideways 2 feet either side of the pipe you gain the effect of burying the pipe 2 feet deeper, so it's much more resistant to freezing. Just expose the top of the pipe, and a 4 foot wide strip centered on the pipe, place insulation 4 feet wide, and replace dirt and sod over the insulation.
You could also, with not much more work, replace that final section of pipe with a 4" pipe (in addition to, not instead of, insulating it.)
An alternate approach that's more work would be to change the termination of the pipe to a dry well, where the end of the pipe is not out in the weather at all, and just dumps into a buried, perforated barrel filled with large-size drain rock. If the burial depth is still shallow, you might still want the styrofoam on the last bit of pipe.
If you are fixed on an electrical solution, "inside the pipe" heat tape is generally more reliable, but would be dubious for this application since the pipe is not normally full of water.