LoginSignup
0
0

不等式√(x2+2x-3)<2x+6「2019 東京都市大 工・知識工 1(1)」をChatGPTとWolframAlphaとsympyでやってみたい。

Last updated at Posted at 2023-08-05

グラフがでます。

オリジナル(PDF) (19 東京都市大 工・知識工 1(1))

>私(mrrclb48z)のコメントが、あります。

上と同じです。大学入試数学問題集成>テキスト【】()
未登録

xxxx ChatGPT で(できませんでした。) xxx

入力文

不等式√(x2+2x-3)<2x+6 を解け

XXXXX ?? 条件を満たす解は存在しません。 ?? xxxxx

WolframAlpha で

グラフは,でませんでした。計算だけです。

グラフがでます。実数の範囲の定義が不足しています。

sympyで(数学入試問題 様のやり方で)

・同値変形に挑戦しました。できませんでした。最終行のandがおかしいです。
・sympyで自動的に、print文を発生してほしいです。

from sympy import *
x=symbols('x',real=True)
my1 =Lt(sqrt(x**2+2*x-3),2*x+6    )           ;print("#",my1 )
print()  
my2A=Lt(my1.lhs**2,my1.rhs**2 )               ;print("#",my2A)  
my2B=Ge(my1.lhs**2,0            )             ;print("#",my2B)  
my2C=Ge(my1.rhs  ,0             )             ;print("#",my2C)
print()  
my3A=Gt((my2A.rhs-my2A.lhs).simplify(),0 )    ;print("#",my3A)  
my3B=my2B                                     ;print("#",my3B)  
my3C=solve(my2C)                              ;print("#",my3C)
print()  
my4A=Gt(factor(my3A.lhs),0 )                  ;print("#",my4A)  
my4B=Ge(factor(my3B.lhs),0 )                  ;print("#",my4B)  
my4C=solve(my2C)                              ;print("#",my4C)
print()  
my5A=solve(my4A)                              ;print("#",my5A)  
my5B=solve(my4B)                              ;print("#",my5B)  
my5C=my4C                                     ;print("#",my5C)
print() 
print("#",my5A and my5B and my5C    )
# sqrt(x**2 + 2*x - 3) < 2*x + 6

# x**2 + 2*x - 3 < (2*x + 6)**2
# x**2 + 2*x - 3 >= 0
# 2*x + 6 >= 0

# 3*x**2 + 22*x + 39 > 0
# x**2 + 2*x - 3 >= 0
# -3 <= x

# (x + 3)*(3*x + 13) > 0
# (x - 1)*(x + 3) >= 0
# -3 <= x

# (-3 < x) | (x < -13/3)
# (1 <= x) | (x <= -3)
# -3 <= x

# -3 <= x   ???????????????????????

sympyで(solveで)

from sympy import *
x=symbols('x',real=True)
myLt=Lt(sqrt(x**2+2*x-3),2*x+6)
print("#",solve(myLt,x))
plot(myLt.lhs,myLt.rhs,(x,-10,10),
     aspect_ratio=(1.0,1.0),xlim=(-10,10),ylim=(-10,10) )
# 1 <= x

aspect_ratioを使ってみました。(参考あり)
0png.png

sympyの実行環境

①私の環境は,pycharmです。
②よく聞くのは、Jupyterです。
③web上で、上記のソースを「SymPy Live shell」に、コピー貼り付けでもできました。
黒背景の右上に、マウスを移動すると、コピーマークが発生します。
??? タブレット環境で、コピー貼り付けが実行できませんでした。???

参考

>aspect_ratio<plot

以下、いつもの?おすすめです。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0