Question: Multiple integrals with python don't work

The environment is python 3.7.6, windows10.

The multiple integral integrate.nquad doesn't seem to work well and the result should be 1.000 (because it's a simultaneous probability density function), but it returns 1.326. How can I get multiple integrals correctly? code import numpy as np from scipy import integrate

def f_xy(x, y):    if 0 <= y <= 1 and 0 <= x-y <= 1:       return 4 * y * (x - y)    else:       return 0

integrate.nquad(f_xy, [[-np.inf, np.inf],[-np.inf, np.inf]])[0]

Out: 1.326

Recommended Posts

Question: Multiple integrals with python don't work
Multiple integrals with Python and Sympy
Search engine work with python
Post multiple Twitter images with python
Animate multiple still images with Python
When matplotlib doesn't work with python2.7
[Python] Creating multiple windows with Tkinter
How to work with BigQuery in Python
Process multiple lists with for in Python
To work with timestamp stations in Python
Manage multiple Python versions with update-alternatives (Ubuntu)
Don't work Python with OpenCV on AMD Ryzen CPU on WSL2 Ubuntu 18.04 And 20.04
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
[Python] How to draw multiple graphs with Matplotlib
Twilio with Python
Manage Python multiple version environment with Pythonz, virtualenv
Use multiple versions of python environment with pyenv
Play with 2016-Python
Tested with Python
Developed and verified with multiple python versions with direnv
with syntax (Python)
Work in a virtual environment with Python virtualenv.
Bingo with python
Zundokokiyoshi with python
[Python] Dealing with multiple call errors in ray.init
Manage multiple context managers together with Python contextlib.ExitStack
Make Python built with jhbuild work on OSX
Convert multiple proto files at once with python
[Python] Mention to multiple people with Slack API
Excel with Python
Microcomputer with Python
Cast with python
I want to work with a robot in python.
Write multiple records to DynamoDB with Lambda (Python, JavaScript)
Remove headings from multiple format CSV files with python
Serial communication with Python
Zip, unzip with python
Django 1.11 started with Python3.6
Primality test with Python
Python with eclipse + PyDev.
Socket communication with Python
Data analysis with python 2
Multiple selections with Jupyter
Scraping with Python (preparation)
Try scraping with Python.
Learning Python with ChemTHEATER 03
Sequential search with Python
"Object-oriented" learning with python
Run Python with VBA
Handling yaml with python
Solve AtCoder 167 with python
Serial communication with python
[Python] Use JSON with Python
Learning Python with ChemTHEATER 05-1
Learn Python with ChemTHEATER
1.1 Getting Started with Python
Binarization with OpenCV / Python