Failed a class, any chance at UT?

I know what you guys are thinking, I know I screwed up, but this is very important to me.
I’ve always been in the hardest math and science class at my school and I’ve always done really well in them so it was a huge shock to me when I failed the second semester of Physics C. Basically the combination of my second semester senior friends, my overconfidence/ego, clueless teacher, and my complete incompetence at e&m led to me somehow failing a class. I know failing a class will leave a huge black mark on my application but I want to know if have any chance of getting into UT.

Anyway here is my application:

In state Applicant

First Choice Major-Mathematics
Second Choice Major-Undeclared

Top 25% (Dropped alot, should be able to go up senior year)
SAT:2030 (M 800, CR 680, W 550)
SAT II Math: 800

I have gotten credit for several ap classes but I’ll just list the ones that are applicable to my major
All 5’s
Calculus AB
Calculus BC
Physics C: Mechanics
Computer Science

ECs:

Tennis:
Team Captain, four years on varsity.
USTA rated superchamp in 12s,14s,16s,and 18s.

3 Star on tennisrecruiting.net (good but not good enough for any appealing d1 offers)

Boy Scouts-Eagle Scout
AIME Qualifier 9th,10th
Software Engineering Team. 6th in nation in 9th. 2nd in nation in 10th
BPA State qualifier 9th, 10th, 11th
DECA Statae qualifier 9th, 10th, 11th
Involved in orchestra. I’m not very good but our orchestra won state a few years ago.
About 100 volunteer hours
Internship for a software company. Mainly did errands and some programming.

Not sure if I can put these in since their from middle school:
Mathcounts Team Captain in 8th grade. Finished 17th in state as a team, and 9th individually.
Special Duke TIP Award for getting an 800 on math SAT in 7th grade.

As you can see I have been blessed with an incredible math talent, Tennis is another huge part of my life and takes up majority of my time. I may not have put as much effort into school as I should have but I have always gotten pretty good grades. Before this year I honestly considered UT a safety school and I never would have imagined myself to be in this position.
Not only was failing physics C a wakeup call for my high school grades, it was a wakeup call for my career choices. Before I was deadset on applying to mechanical engineering or computer science. Now i’m afraid of anything electrical engineering related and might be switching to business (no physics, and I liked economics, but not as appealing and I feel like I would be wasting my math talent.)
I understand how far back failing a class puts me but I would really like to know if I have any shot at getting into UT (Even getting in undeclared would be huge since I’m confident I can make it up in college)
Also how does failing a class affect my college application in general.

Thanks

You’re a really interesting applicant. I don’t think the Physics C grade is so much a problem as the overall class rank, since UT has so few spots for non-top 7% applicants and you are interested in competitive majors. Your math scores are extraordinary, you’ve got solid extracurriculars, and I think you need to go ahead and apply. Just make sure you are comfortable with your back-up choices because of the class rank issue. A lot of schools would be happy to have you though and I wish you luck.