
    sg                         d Z ddlmZmZ ddlmZ ddlmZmZ  G d de      Z	 G d de	      Z
 G d	 d
e	      Z G d de	      Z G d de	      Zy)z- This module contains the Mathieu functions.
    )FunctionArgumentIndexError)sqrt)sincosc                       e Zd ZdZdZd Zy)MathieuBasezj
    Abstract base class for Mathieu functions.

    This class is meant to reduce code duplication.

    Tc                     | j                   \  }}}| j                  |j                         |j                         |j                               S N)argsfunc	conjugate)selfaqzs       \/var/www/html/venv/lib/python3.12/site-packages/sympy/functions/special/mathieu_functions.py_eval_conjugatezMathieuBase._eval_conjugate   s6    ))1ayyq{{}EE    N)__name__
__module____qualname____doc__
unbranchedr    r   r   r	   r	   	   s     JFr   r	   c                   (    e Zd ZdZddZed        Zy)mathieusa  
    The Mathieu Sine function $S(a,q,z)$.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Cosine function.

    Examples
    ========

    >>> from sympy import diff, mathieus
    >>> from sympy.abc import a, q, z

    >>> mathieus(a, q, z)
    mathieus(a, q, z)

    >>> mathieus(a, 0, z)
    sin(sqrt(a)*z)

    >>> diff(mathieus(a, q, z), z)
    mathieusprime(a, q, z)

    See Also
    ========

    mathieuc: Mathieu cosine function.
    mathieusprime: Derivative of Mathieu sine function.
    mathieucprime: Derivative of Mathieu cosine function.

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuS/

    c                 ^    |dk(  r| j                   \  }}}t        |||      S t        | |      N   )r   mathieusprimer   r   argindexr   r   r   s        r   fdiffzmathieus.fdiffF   4    q=iiGAq! Aq))$T844r   c                     |j                   r#|j                  rt        t        |      |z        S |j	                         r | |||        S y r   )	is_Numberis_zeror   r   could_extract_minus_signclsr   r   r   s       r   evalzmathieus.evalM   sD    ;;199tAwqy>!%%'1qbM>! (r   N   r   r   r   r   r$   classmethodr,   r   r   r   r   r      !    +Z5 " "r   r   c                   (    e Zd ZdZddZed        Zy)mathieuca  
    The Mathieu Cosine function $C(a,q,z)$.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Sine function.

    Examples
    ========

    >>> from sympy import diff, mathieuc
    >>> from sympy.abc import a, q, z

    >>> mathieuc(a, q, z)
    mathieuc(a, q, z)

    >>> mathieuc(a, 0, z)
    cos(sqrt(a)*z)

    >>> diff(mathieuc(a, q, z), z)
    mathieucprime(a, q, z)

    See Also
    ========

    mathieus: Mathieu sine function
    mathieusprime: Derivative of Mathieu sine function
    mathieucprime: Derivative of Mathieu cosine function

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuC/

    c                 ^    |dk(  r| j                   \  }}}t        |||      S t        | |      r   )r   mathieucprimer   r"   s        r   r$   zmathieuc.fdiff   r%   r   c                     |j                   r#|j                  rt        t        |      |z        S |j	                         r | |||       S y r   )r'   r(   r   r   r)   r*   s       r   r,   zmathieuc.eval   sB    ;;199tAwqy>!%%'q!aR=  (r   Nr-   r/   r   r   r   r3   r3   V   !    +Z5 ! !r   r3   c                   (    e Zd ZdZddZed        Zy)r!   a"  
    The derivative $S^{\prime}(a,q,z)$ of the Mathieu Sine function.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Cosine function.

    Examples
    ========

    >>> from sympy import diff, mathieusprime
    >>> from sympy.abc import a, q, z

    >>> mathieusprime(a, q, z)
    mathieusprime(a, q, z)

    >>> mathieusprime(a, 0, z)
    sqrt(a)*cos(sqrt(a)*z)

    >>> diff(mathieusprime(a, q, z), z)
    (-a + 2*q*cos(2*z))*mathieus(a, q, z)

    See Also
    ========

    mathieus: Mathieu sine function
    mathieuc: Mathieu cosine function
    mathieucprime: Derivative of Mathieu cosine function

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuSPrime/

    c                     |dk(  r5| j                   \  }}}d|z  t        d|z        z  |z
  t        |||      z  S t        | |      Nr       )r   r   r   r   r"   s        r   r$   zmathieusprime.fdiff   N    q=iiGAq!aCAaCL1$hq!Q&777$T844r   c                     |j                   r/|j                  r#t        |      t        t        |      |z        z  S |j	                         r | |||       S y r   )r'   r(   r   r   r)   r*   s       r   r,   zmathieusprime.eval   sK    ;;19973tAwqy>))%%'q!aR=  (r   Nr-   r/   r   r   r   r!   r!      r7   r   r!   c                   (    e Zd ZdZddZed        Zy)r5   a!  
    The derivative $C^{\prime}(a,q,z)$ of the Mathieu Cosine function.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Sine function.

    Examples
    ========

    >>> from sympy import diff, mathieucprime
    >>> from sympy.abc import a, q, z

    >>> mathieucprime(a, q, z)
    mathieucprime(a, q, z)

    >>> mathieucprime(a, 0, z)
    -sqrt(a)*sin(sqrt(a)*z)

    >>> diff(mathieucprime(a, q, z), z)
    (-a + 2*q*cos(2*z))*mathieuc(a, q, z)

    See Also
    ========

    mathieus: Mathieu sine function
    mathieuc: Mathieu cosine function
    mathieusprime: Derivative of Mathieu sine function

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuCPrime/

    c                     |dk(  r5| j                   \  }}}d|z  t        d|z        z  |z
  t        |||      z  S t        | |      r:   )r   r   r3   r   r"   s        r   r$   zmathieucprime.fdiff   r<   r   c                     |j                   r0|j                  r$t        |       t        t        |      |z        z  S |j	                         r | |||        S y r   )r'   r(   r   r   r)   r*   s       r   r,   zmathieucprime.eval  sO    ;;199G8CQ	N**%%'1qbM>! (r   Nr-   r/   r   r   r   r5   r5      r1   r   r5   N)r   sympy.core.functionr   r   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   r   r	   r   r3   r!   r5   r   r   r   <module>rD      sV    = 9 =F( F;"{ ;"|;!{ ;!|;!K ;!|;"K ;"r   