初等函数和它的表达式

        常量函数,幂函数,指数函数,对数函数,三角函数和反三角函数成为基本初等函数。基本初等函数经过有限四则运算和符合运算得到的函数称为初等函数。

1. 常量函数

  • 表达式: f(x)=C (其中 c 是常数)
  • 参数的意思: 是一个固定的常数。
  • 定义域:c\in(-\infty ,+\infty)
  • 值域: (-\infty ,+\infty)
  • 奇偶性: 偶函数(f(-x)=f(x))
  • 单调性: 不单调
  • 周期性: 周期性(周期为任意值)
  • manim示例:
    from manim import *  
    
    class FunctionC1(Scene):  
        def construct(self):   
            a1=MathTex("constant Function").shift(3.5*UP) 
            self.add(a1)
            title = Title().shift(3.4*UP)  
            self.add(title)  
            
            # Create axes and shift them down  
            ax = Axes().add_coordinates().shift(0.2*DOWN)  
            
            # Plot the constant function f(x) = 1  
            curve = ax.plot(lambda x: 1, color=DARK_BLUE)  
            label = MathTex(r"f(x) = 1  \\ c=1").next_to([-3,1.5,0], buff=0.1).set_color(DARK_BLUE)
            
            # Add a label to the curve  
            #label = MathTex("f(x) = 1").next_to(curve, UR, buff=0.2).set_color(DARK_BLUE).shift(2*LEFT)  
            
            # Add the axes and the curve to the scene  
            self.add(ax, curve, label) 


2. 幂函数

  • 表达式: f(x)=x^{n}(其中 n为常数)
  • 参数的意思: n是幂的指数。
  • 定义域:
    • n为正整数:x\in (−∞,+∞)
    • n为负整数: x>0
  • 值域:
    • n为偶数:[0,+∞)
    • n为奇数: (−∞,+∞)
    • n为负数: (0,+∞)(当 x>0)
  • 奇偶性:
    • 偶函数(当 n为偶数)
    • 奇函数(当 n 为奇数)
  • 单调性:
    • 当 n>0 时,单调递增(n为奇数时可在 x<0 区间内非单调)
    • 当 n<0 时,在 x>0 区间单调递减。
  • 周期性: 非周期性

示例: 

from manim import *  

class FunctionPow(Scene):  
    def construct(self):   
        # Title for the plot  
        title = Title("Power Functions")  
        self.add(title)  
        
        # Create axes  
        ax = Axes().add_coordinates().shift(0.2*DOWN)  
        #ax.add_coordinate_labels()  # 添加坐标标签  

        # Plot the functions with appropriate ranges  
        curve1 = ax.plot(lambda x: x**(-2), color=DARK_BLUE, x_range=[0.1, 2.3])  # x > 0  
        curve2 = ax.plot(lambda x: x**0.5, color=YELLOW, x_range=[0, 2.3])      # x >= 0  
        curve3 = ax.plot(lambda x: x**1, color=GREEN, x_range=[-2.4, 2.3])  
        curve4 = ax.plot(lambda x: x**3, color=ORANGE, x_range=[-1.5, 1.2])  

        # Add labels to the curves  
        label1 = MathTex(r"f(x) = x^{-2}").next_to([2,0.5,0], buff=0.1).set_color(DARK_BLUE)  
        label2 = MathTex(r"g(x) = x^{0.5}").next_to(curve2, UR, buff=0.1).set_color(YELLOW)  
        label3 = MathTex(r"h(x) = x").next_to(curve3, UR, buff=0.1).set_color(GREEN)  
        label4 = MathTex(r"i(x) = x^3").next_to(curve4, DL, buff=0.1).set_color(ORANGE)  

        # Add everything to the scene  
        self.add(ax, curve1, curve2, curve3, curve4, label1, label2, label3, label4)  

3. 指数函数

  • 表达式: f(x)=a^{x} (其中 a>0,a≠1)
  • 参数的意思: a是基数,x是指数。
  • 定义域: x\in(−∞,+∞)
  • 值域: (0,+∞)
  • 奇偶性: 非奇偶函数
  • 单调性:
    • a>1时,单调递增
    • 0<a<1时,单调递减
  • 周期性: 非周期性

 

from manim import *  
import math as ma

class FunctionExponential(Scene):  
    def construct(self):   
        # Title for the plot  
        title = Title("Exponential Function")  
        self.add(title)  
        
        # Create axes  
        ax = Axes(x_range=[-1,9],y_range=[-1,9],x_length=12,y_length=6).add_coordinates().shift(0.2*DOWN)  
        #ax.add_coordinate_labels()  # 添加坐标标签  

        # Plot the functions with appropriate ranges  
        curve1 = ax.plot(lambda x: 0.5**x, color=DARK_BLUE, x_range=[-5, 5])  # 1> a > 0  
        curve2 = ax.plot(lambda x: 1.5**x, color=YELLOW, x_range=[-5, 2.7])      # a>1 
        curve3 = ax.plot(lambda x: ma.exp(x), color=PINK, x_range=[-5, 2.7])      # a>1 
          

        # Add labels to the curves  
        label1 = MathTex(r"f(x) = 0.5^{x} \\ a=0.5,0<a<1").next_to([1.5,-1,0], buff=0.1).set_color(DARK_BLUE)  
        label2 = MathTex(r"g(x) = 1.5^{x} \\ a=2,a>1").next_to(curve2, UR, buff=0.1).set_color(YELLOW)  
        label3 = MathTex(r"g(x) = e^{x} \\ a=2,a>1").next_to([-2,2,0]).set_color(PINK)  

        # Add everything to the scene  
        self.add(ax, curve1, curve2,curve3,  label1, label2,label3)  

4. 对数函数

  • 表达式:f(x)=log_{a}{x}(其中 a>0,a≠1)
  • 参数的意思: a是底数,x 是对数的真数。
  • 定义域: x\in(0,+∞)
  • 值域: f(x)\in(−∞,+∞)
  • 奇偶性: 非奇偶函数
  • 单调性: 单调递增
  • 周期性: 非周期性

 

from manim import *  
import math as ma  

class FunctionLogarithm(Scene):  
    def construct(self):   
        # Title for the plot  
        title = Title("Logarithmic Functions")  
        self.add(title)  
        
        # Create axes  
        ax = Axes(x_range=[0.01, 9], y_range=[-3, 3], x_length=10, y_length=5).add_coordinates().shift(0.2*DOWN)  
        
        # Plot the functions with appropriate ranges  
        curve1 = ax.plot(lambda x: ma.log(x, 0.5), color=DARK_BLUE, x_range=[0.01, 6])  # a < 1  
        curve2 = ax.plot(lambda x: ma.log(x, 2), color=YELLOW, x_range=[0.01, 8])      # a = 2  
        curve3 = ax.plot(lambda x: ma.log(x), color=PINK, x_range=[0.01, 8])           # a = e  

        # Add labels to the curves  
        label1 = MathTex(r"f(x) = \log_{0.5}{x} \\ a=0.5, 0<a<1").next_to([2.5, -2, 0], buff=0.1).set_color(DARK_BLUE)  
        label2 = MathTex(r"g(x) = \log_{2}{x} \\ a=2").next_to(curve3, UR, buff=0.1).set_color(YELLOW)  
        label3 = MathTex(r"h(x) = \log{x} \\ a=e").next_to([2.5,0.5, 0], buff=0.1).set_color(PINK)  

        # Add everything to the scene  
        self.add(ax, curve1, curve2, curve3, label1, label2, label3)  

5. 三角函数

  • 表达式:
    • 正弦函数: f(x)=sin⁡xf(x)=sinx
    • 余弦函数: f(x)=cos⁡xf(x)=cosx
    • 正切函数: f(x)=tan⁡xf(x)=tanx
  • 参数的意思: xx 是角度(通常以弧度为单位)。
  • 定义域:
    • sin⁡(x)和 cos⁡(x): x\in(−∞,+∞)
    • tan(⁡x):x\neq \frac{\pi }{2}+k\pi(k\in \mathbb{Z})
  • 值域:
    • sin⁡(x)和 cos⁡(x): [−1,1][−1,1]
    • tan(⁡x): (−∞,+∞)
  • 奇偶性:
    • sin⁡x: 奇函数
    • cos⁡x: 偶函数
    • tan⁡x: 奇函数
  • 单调性:
    • sin⁡x: 在 (2kπ,(2k+1)π) 上单调递增
    • cos⁡x: 在 (2kπ,(2k+1)π)上单调递减
    • tan⁡x: 在每个周期内单调递增
  • 周期性:
    • sin⁡(x)和 cos⁡(x): 周期 2π
    • tan⁡x: 周期 ππ

 

from manim import *  
import numpy as np  

class FunctionTrigonometric(Scene):  
    def construct(self):   
        # Title for the plot  
        title = Title("Trigonometric Functions")  
        self.add(title)  
        
        # Create axes  
        ax = Axes(x_range=[-6, 6], y_range=[-2, 2], x_length=12, y_length=6).add_coordinates().shift(0.2*DOWN)  
        
        # Plot the functions with appropriate ranges  
        curve1 = ax.plot(np.sin, color=DARK_BLUE, x_range=[-6, 4])  # Sin function  
        curve2 = ax.plot(np.cos, color=YELLOW, x_range=[-6, 5])     # Cos function  
        curve3 = ax.plot(np.tan, color=PINK, x_range=[-1.19, 1])   # Tan function  

        # Add labels to the curves  
        label1 = MathTex(r"f(x) = \sin{x}").next_to(curve1, DR, buff=0.1).set_color(DARK_BLUE)  
        label2 = MathTex(r"g(x) = \cos{x}").next_to(curve2, UR, buff=0.1).set_color(YELLOW)  
        label3 = MathTex(r"h(x) = \tan{x}").next_to(curve3, UR, buff=0.1).set_color(PINK)  

        # Add everything to the scene  
        self.add(ax, curve1, curve2, curve3, label1, label2, label3)  

6. 反三角函数

  • 表达式:
    • arcsin(⁡x)
    • arccos⁡(x)
    • arctan(⁡x)
  • 参数的意思: x是三角函数的值。
  • 定义域:
    • arcsin(⁡x): [−1,1]
    • arccos⁡(x: [−1,1]
    • arctan(⁡x): (−∞,+∞)
  • 值域:
    • arcsin(⁡x):[-\frac{\pi}{2},\frac{\pi}{2}]
    • arccos(⁡x):[0,\pi]
    • arctan(⁡x): (-\frac{\pi}{2},\frac{\pi}{2})
  • 奇偶性:
    • arcsin⁡x: 奇函数
    • arccos⁡x: 非奇偶函数
    • arctan⁡x: 奇函数
  • 单调性:
    • arcsin⁡x: 单调递增
    • arccos⁡x: 单调递减
    • arctan⁡x: 单调递增
  • 周期性: 非周期性

 

from manim import *  
import numpy as np 
import math

class FunctionInverseTrigonometric(Scene):  
    def construct(self):   
        # Title for the plot  
        title = Title("Inverse Trigonometric Functions")  
        self.add(title)  
        
        # Create axes  
        ax = Axes(x_range=[-7.5, 7.5], y_range=[-5, 5], x_length=12, y_length=6).add_coordinates().shift(0.2*DOWN)  
        
        # Plot the functions with appropriate ranges  
        curve1 = ax.plot(np.arcsin, color=DARK_BLUE, x_range=[-1, 1])  # Inverse Sin function  
        curve2 = ax.plot(math.acos, color=YELLOW, x_range=[-1, 1])     # Inverse Cos function  
        curve3 = ax.plot(np.arctan, color=PINK, x_range=[-10, 4])       # Inverse Tan function  

        # Add labels to the curves  
        label1 = MathTex(r"f(x) = \arcsin{x}").next_to(curve1, UR+3*UP, buff=0.1).set_color(DARK_BLUE)  
        label2 = MathTex(r"g(x) = \arccos{x}").next_to(curve2, DR+5*DOWN, buff=0.1).set_color(YELLOW)  
        label3 = MathTex(r"h(x) = \arctan(x)").next_to(curve3, UR, buff=0.1).set_color(PINK)  

        # Add everything to the scene  
        self.add(ax, curve1, curve2, curve3, label1, label2, label3)  

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yasen.M

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值