o
    i                     @   s   d Z ddlmZmZ ddlmZ ddlmZmZ G dd deZ	G dd de	Z
G d	d
 d
e	ZG dd de	ZG dd de	ZdS )z- This module contains the Mathieu functions.
    )DefinedFunctionArgumentIndexError)sqrt)sincosc                   @   s   e Zd ZdZdZdd ZdS )MathieuBasezj
    Abstract base class for Mathieu functions.

    This class is meant to reduce code duplication.

    Tc                 C   s&   | j \}}}| | | | S N)argsfunc	conjugate)selfaqz r   x/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/sympy/functions/special/mathieu_functions.py_eval_conjugate   s   zMathieuBase._eval_conjugateN)__name__
__module____qualname____doc__Z
unbranchedr   r   r   r   r   r   	   s    r   c                   @   &   e Zd ZdZdddZedd ZdS )	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                 C   *   |dkr| j \}}}t|||S t| |N   )r	   mathieusprimer   r   Zargindexr   r   r   r   r   r   fdiffF      
zmathieus.fdiffc                 C   s8   |j r|jrtt|| S | r| |||  S d S r   )	is_Numberis_zeror   r   could_extract_minus_signclsr   r   r   r   r   r   evalM   s
   zmathieus.evalNr   r   r   r   r   r   classmethodr&   r   r   r   r   r      
    
-r   c                   @   r   )	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/

    r   c                 C   r   r   )r	   mathieucprimer   r   r   r   r   r      r    zmathieuc.fdiffc                 C   s6   |j r|jrtt|| S | r| ||| S d S r   )r!   r"   r   r   r#   r$   r   r   r   r&      s
   zmathieuc.evalNr'   r(   r   r   r   r   r+   V   r*   r+   c                   @   r   )	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/

    r   c                 C   B   |dkr| j \}}}d| td|  | t||| S t| |Nr      )r	   r   r   r   r   r   r   r   r         $
zmathieusprime.fdiffc                 C   s>   |j r|jrt|tt||  S | r| ||| S d S r   )r!   r"   r   r   r#   r$   r   r   r   r&      s
   zmathieusprime.evalNr'   r(   r   r   r   r   r      r*   r   c                   @   r   )	r,   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/

    r   c                 C   r-   r.   )r	   r   r+   r   r   r   r   r   r      r0   zmathieucprime.fdiffc                 C   sB   |j r|jrt| tt||  S | r| |||  S d S r   )r!   r"   r   r   r#   r$   r   r   r   r&     s
   zmathieucprime.evalNr'   r(   r   r   r   r   r,      r*   r,   N)r   Zsympy.core.functionr   r   Z(sympy.functions.elementary.miscellaneousr   Z(sympy.functions.elementary.trigonometricr   r   r   r   r+   r   r,   r   r   r   r   <module>   s    >>>