# Kurvendiskussion Extrema und Wendepunkt von # ganzrat. Funktionen 3. Grades (ohne DT list) glg="y= Ax^3+Bx^2+Cx" #print(glg) A0=float(input(glg+" A=")) B0=float(input(glg+" B=")) C0=float(input(glg+" C=")) #Teil-1 1. bis 3. Ableitung bilden und als Glg ausgeben sB0=str(B0) sC0=str(C0) if B0>=0: sB0="+"+str(B0) if C0>=0: sC0="+"+str(C0) print("y="+str(A0)+"x^3"+sB0+"x^2"+sC0+"x") # 1.Ableitung A1=3*A0 B1=2*B0 C1=C0 sB1=str(B1) sC1=str(C1) if B1>=0: sB1="+"+str(B1) if C1>=0: sC1="+"+str(C1) print("y'="+str(A1)+"x^2"+sB1+"x"+sC1) # 2. Ableitung A2=2*A1 B2=B1 sB2=str(B2) if B2>=0: sB2="+"+str(B2) print("y''="+str(A2)+"x"+sB2) # 3. Ableitung A3=A2 B3=0 print("y'''="+str(A3)) # ExtremPunkte berechnen if A1!=0: # Es ist eine Glg 3. Grades p=B1/A1 q=C1/A1 d=p*p/4-q if d<0: print("Keine Extrema") if d==0: xe1=-p/2 ye1=A0*xe1**3+B0*xe1**2+C0*xe1 art1=A1*xe1**2+B1*xe1 if art1>0: print("Pmin(",xe1,"|",ye1,")") else: print("Pmax(",xe1,"|",ye1,")") if d>0: xe1=round(-p/2+d**0.5,3) xe2=round(-p/2-d**0.5,3) ye1=round(A0*xe1**3+B0*xe1**2+C0*xe1,3) ye2=round(A0*xe2**3+B0*xe2**2+C0*xe2,3) art1=A2*xe1**2+B2*xe1 # Einsetzen in 2. Ablg art2=A2*xe2**2+B2*xe2 if art1>0: print("Pmin(",xe1,"|",ye1,")") else: print("Pmax(",xe1,"|",ye1,")") if art2>0: print("Pmin(",xe2,"|",ye2,")") else: print("Pmax(",xe2,"|",ye2,")") # Wendepunkt ermitteln A2x+B2=0 if A2!=0: xw=-B2/A2 if A3*xw==0: print("Kein Wendepunkt") else: yw=round(A0*xw**3+B0*xw**2+C0*xw,2) print("Pw(",xw,"|",yw,")") else: print("Keine Gleichung 3. Grades")